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

Side by Side Diff: ui/aura_shell/shell.cc

Issue 8465021: Add ShellAcceleratorController that managers global keyboard accelerators. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add ShellAcceleratorController 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura_shell/shell.h" 5 #include "ui/aura_shell/shell.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "ui/aura/aura_switches.h" 9 #include "ui/aura/aura_switches.h"
10 #include "ui/aura/desktop.h" 10 #include "ui/aura/desktop.h"
11 #include "ui/aura/window.h" 11 #include "ui/aura/window.h"
12 #include "ui/aura/window_types.h" 12 #include "ui/aura/window_types.h"
13 #include "ui/aura_shell/default_container_event_filter.h" 13 #include "ui/aura_shell/default_container_event_filter.h"
14 #include "ui/aura_shell/default_container_layout_manager.h" 14 #include "ui/aura_shell/default_container_layout_manager.h"
15 #include "ui/aura_shell/desktop_event_filter.h" 15 #include "ui/aura_shell/desktop_event_filter.h"
16 #include "ui/aura_shell/desktop_layout_manager.h" 16 #include "ui/aura_shell/desktop_layout_manager.h"
17 #include "ui/aura_shell/launcher/launcher.h" 17 #include "ui/aura_shell/launcher/launcher.h"
18 #include "ui/aura_shell/modal_container_layout_manager.h" 18 #include "ui/aura_shell/modal_container_layout_manager.h"
19 #include "ui/aura_shell/shelf_layout_controller.h" 19 #include "ui/aura_shell/shelf_layout_controller.h"
20 #include "ui/aura_shell/shell_accelerator_controller.h"
20 #include "ui/aura_shell/shell_delegate.h" 21 #include "ui/aura_shell/shell_delegate.h"
21 #include "ui/aura_shell/shell_factory.h" 22 #include "ui/aura_shell/shell_factory.h"
22 #include "ui/aura_shell/shell_window_ids.h" 23 #include "ui/aura_shell/shell_window_ids.h"
23 #include "ui/aura_shell/stacking_controller.h" 24 #include "ui/aura_shell/stacking_controller.h"
24 #include "ui/aura_shell/toplevel_layout_manager.h" 25 #include "ui/aura_shell/toplevel_layout_manager.h"
25 #include "ui/aura_shell/toplevel_window_event_filter.h" 26 #include "ui/aura_shell/toplevel_window_event_filter.h"
26 #include "ui/aura_shell/workspace_controller.h" 27 #include "ui/aura_shell/workspace_controller.h"
27 #include "ui/gfx/compositor/layer.h" 28 #include "ui/gfx/compositor/layer.h"
28 #include "ui/gfx/compositor/layer_animator.h" 29 #include "ui/gfx/compositor/layer_animator.h"
29 #include "views/widget/native_widget_aura.h" 30 #include "views/widget/native_widget_aura.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } // namespace 89 } // namespace
89 90
90 // static 91 // static
91 Shell* Shell::instance_ = NULL; 92 Shell* Shell::instance_ = NULL;
92 93
93 //////////////////////////////////////////////////////////////////////////////// 94 ////////////////////////////////////////////////////////////////////////////////
94 // Shell, public: 95 // Shell, public:
95 96
96 Shell::Shell(ShellDelegate* delegate) 97 Shell::Shell(ShellDelegate* delegate)
97 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), 98 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
99 accelerator_controller_(new ShellAcceleratorController),
98 delegate_(delegate) { 100 delegate_(delegate) {
99 aura::Desktop::GetInstance()->SetEventFilter( 101 aura::Desktop::GetInstance()->SetEventFilter(
100 new internal::DesktopEventFilter); 102 new internal::DesktopEventFilter);
101 aura::Desktop::GetInstance()->SetStackingClient( 103 aura::Desktop::GetInstance()->SetStackingClient(
102 new internal::StackingController); 104 new internal::StackingController);
103 } 105 }
104 106
105 Shell::~Shell() { 107 Shell::~Shell() {
106 DCHECK(instance_ == this); 108 DCHECK(instance_ == this);
107 instance_ = NULL; 109 instance_ = NULL;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 new internal::WorkspaceController(default_container)); 219 new internal::WorkspaceController(default_container));
218 workspace_controller_->SetLauncherModel(launcher_->model()); 220 workspace_controller_->SetLauncherModel(launcher_->model());
219 default_container->SetEventFilter( 221 default_container->SetEventFilter(
220 new internal::DefaultContainerEventFilter(default_container)); 222 new internal::DefaultContainerEventFilter(default_container));
221 default_container->SetLayoutManager( 223 default_container->SetLayoutManager(
222 new internal::DefaultContainerLayoutManager( 224 new internal::DefaultContainerLayoutManager(
223 workspace_controller_->workspace_manager())); 225 workspace_controller_->workspace_manager()));
224 } 226 }
225 227
226 } // namespace aura_shell 228 } // namespace aura_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698