Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2686)

Unified Diff: athena/input/public/accelerator_manager.h

Issue 332443005: Enable accelerators on web activity window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: athena/input/public/accelerator_manager.h
diff --git a/athena/input/public/accelerator_manager.h b/athena/input/public/accelerator_manager.h
index bb700f9e1c84a45c44472f8c934e8f94033305a9..b572c50f753d501de7765fa0c0786b3b9cc74296 100644
--- a/athena/input/public/accelerator_manager.h
+++ b/athena/input/public/accelerator_manager.h
@@ -6,12 +6,17 @@
#define ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_
#include "athena/athena_export.h"
+#include "base/memory/scoped_ptr.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace ui {
class Accelerator;
}
+namespace views {
+class FocusManager;
+}
+
namespace athena {
enum TriggerEvent {
@@ -53,12 +58,24 @@ class ATHENA_EXPORT AcceleratorHandler {
const ui::Accelerator& accelerator) = 0;
};
-class AcceleratorManager {
+class ATHENA_EXPORT AcceleratorManager {
public:
+ // Returns an AccelerarManager for global acelerators.
static AcceleratorManager* Get();
+ // Creates an AcceleratorManager for application windows that
+ // define their own accelerators.
+ static scoped_ptr<AcceleratorManager> CreateForFocusManager(
+ views::FocusManager* focus_manager);
+
virtual ~AcceleratorManager() {}
+ // Tells if the accelerator is registered with the given flag. If
+ // flags is AF_NONE, it simply tells if the accelerator is
+ // registered with any flags.
+ virtual bool IsRegistered(const ui::Accelerator& accelerator,
+ int flags) const = 0;
+
// Register accelerators and its handler that will be invoked when
// one of accelerator is fired.
virtual void RegisterAccelerators(const AcceleratorData accelerators[],

Powered by Google App Engine
This is Rietveld 408576698