// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This class describe a keyboard accelerator (or keyboard shortcut). // Keyboard accelerators are registered with the FocusManager. // It has a copy constructor and assignment operator so that it can be copied. // It also defines the < operator so that it can be used as a key in a std::map. // #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_H_ #define UI_BASE_ACCELERATORS_ACCELERATOR_H_ #include <memory> #include <string> #include <utility> #include "base/component_export.h" #include "base/time/time.h" #include "build/build_config.h" #include "ui/events/event_constants.h" #include "ui/events/keycodes/keyboard_codes.h" #if BUILDFLAG(IS_CHROMEOS) #include "ui/events/keycodes/dom/dom_code.h" #endif namespace ui { class KeyEvent; // While |modifiers| may include EF_IS_REPEAT, EF_IS_REPEAT is not considered // an intrinsic part of an Accelerator. This is done so that an accelerator // for a particular KeyEvent matches an accelerator with or without the repeat // flag. A side effect of this is that == (and <) does not consider the // repeat flag in its comparison. class COMPONENT_EXPORT(UI_BASE) Accelerator { … }; // An interface that classes that want to register for keyboard accelerators // should implement. class COMPONENT_EXPORT(UI_BASE) AcceleratorTarget { … }; // Since accelerator code is one of the few things that can't be cross platform // in the chrome UI, separate out just the GetAcceleratorForCommandId() from // the menu delegates. class AcceleratorProvider { … }; } // namespace ui #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_