Index: ui/aura_shell/shell.h |
diff --git a/ui/aura_shell/shell.h b/ui/aura_shell/shell.h |
index 1b4c719f3c7af0f3bcbacd60ee931de3c12df6cf..6ccc977126ce90853b129a02aa06cae8c762af16 100644 |
--- a/ui/aura_shell/shell.h |
+++ b/ui/aura_shell/shell.h |
@@ -15,6 +15,7 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/weak_ptr.h" |
#include "ui/aura_shell/aura_shell_export.h" |
+#include "ui/base/models/accelerator.h" |
namespace aura { |
class Window; |
@@ -22,6 +23,9 @@ class Window; |
namespace gfx { |
class Rect; |
} |
+namespace ui { |
+class AcceleratorManager; |
+} |
namespace aura_shell { |
@@ -35,7 +39,7 @@ class WorkspaceController; |
// Shell is a singleton object that presents the Shell API and implements the |
// Desktop's delegate interface. |
-class AURA_SHELL_EXPORT Shell { |
+class AURA_SHELL_EXPORT Shell : public ui::AcceleratorTarget { |
Ben Goodger (Google)
2011/11/16 16:16:10
Rather than making the Shell an accelerator target
|
public: |
// Upon creation, the Shell sets itself as the Desktop's delegate, which takes |
// ownership of the Shell. |
@@ -58,6 +62,14 @@ class AURA_SHELL_EXPORT Shell { |
ShellDelegate* delegate() { return delegate_.get(); } |
Launcher* launcher() { return launcher_.get(); } |
+ // Returns the AcceleratorManager that managers global keyboard shortcuts. |
+ ui::AcceleratorManager* accelerator_manager() { |
+ return accelerator_manager_.get(); |
+ } |
+ |
+ // Overridden from ui::AcceleratorTarget: |
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
+ |
private: |
typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
@@ -82,6 +94,8 @@ class AURA_SHELL_EXPORT Shell { |
scoped_ptr<internal::WorkspaceController> workspace_controller_; |
scoped_ptr<internal::ShelfLayoutController> shelf_layout_controller_; |
+ scoped_ptr<ui::AcceleratorManager> accelerator_manager_; |
+ |
DISALLOW_COPY_AND_ASSIGN(Shell); |
}; |