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

Unified Diff: ui/aura_shell/shell.h

Issue 8465021: Add ShellAcceleratorController that managers global keyboard accelerators. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move AcceleratorPressed to Shell from Desktop Created 9 years, 1 month 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
« no previous file with comments | « ui/aura_shell/global_accelerator_filter.cc ('k') | ui/aura_shell/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ui/aura_shell/global_accelerator_filter.cc ('k') | ui/aura_shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698