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

Unified Diff: ui/aura_shell/shell.cc

Issue 8561012: Add ShellAcceleratorController that manages global keyboard accelerators (2nd try). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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/shell.h ('k') | ui/aura_shell/shell_accelerator_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/shell.cc
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index ddd08b50f4e1832546d3d29a410c82bac5a13d30..94ea6d9727e83d208ccb55866e814fa26aafa071 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -22,6 +22,8 @@
#include "ui/aura_shell/modal_container_layout_manager.h"
#include "ui/aura_shell/shadow_controller.h"
#include "ui/aura_shell/shelf_layout_controller.h"
+#include "ui/aura_shell/shell_accelerator_controller.h"
+#include "ui/aura_shell/shell_accelerator_filter.h"
#include "ui/aura_shell/shell_delegate.h"
#include "ui/aura_shell/shell_factory.h"
#include "ui/aura_shell/shell_window_ids.h"
@@ -100,6 +102,7 @@ Shell* Shell::instance_ = NULL;
Shell::Shell(ShellDelegate* delegate)
: ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
+ accelerator_controller_(new ShellAcceleratorController),
delegate_(delegate) {
aura::Desktop::GetInstance()->SetEventFilter(
new internal::DesktopEventFilter);
@@ -108,6 +111,8 @@ Shell::Shell(ShellDelegate* delegate)
}
Shell::~Shell() {
+ RemoveDesktopEventFilter(accelerator_filter_.get());
+
// Drag drop controller needs a valid shell instance. We destroy it first.
drag_drop_controller_.reset();
@@ -191,6 +196,11 @@ void Shell::Init() {
// Force a layout.
desktop_layout->OnWindowResized();
+ // Initialize ShellAcceleratorFilter
+ accelerator_filter_.reset(new internal::ShellAcceleratorFilter);
+ AddDesktopEventFilter(accelerator_filter_.get());
+
+ // Initialize drag drop controller.
drag_drop_controller_.reset(new internal::DragDropController);
aura::Desktop::GetInstance()->SetProperty(aura::kDesktopDragDropClientKey,
static_cast<aura::DragDropClient*>(drag_drop_controller_.get()));
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_accelerator_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698