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

Unified Diff: ash/aura/wm_shell_aura.cc

Issue 2752593008: Move AcceleratorController from WmShell to Shell (Closed)
Patch Set: fix include Created 3 years, 9 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
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/accelerators/accelerator_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/aura/wm_shell_aura.cc
diff --git a/ash/aura/wm_shell_aura.cc b/ash/aura/wm_shell_aura.cc
index 92c4bd8e20d6ea0a2e209cabc5b334caf52accc5..42029c3c401e9ee6d9b8730e2a60536752309290 100644
--- a/ash/aura/wm_shell_aura.cc
+++ b/ash/aura/wm_shell_aura.cc
@@ -6,8 +6,10 @@
#include <utility>
+#include "ash/accelerators/accelerator_controller_delegate_aura.h"
#include "ash/aura/key_event_watcher_aura.h"
#include "ash/aura/pointer_watcher_adapter.h"
+#include "ash/common/accelerators/accelerator_controller.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shell_delegate.h"
#include "ash/common/shell_observer.h"
@@ -51,6 +53,12 @@ WmShellAura::WmShellAura() {}
WmShellAura::~WmShellAura() {}
+// static
+WmShellAura* WmShellAura::Get() {
+ CHECK(!WmShell::Get()->IsRunningInMash());
+ return static_cast<WmShellAura*>(WmShell::Get());
+}
+
void WmShellAura::Shutdown() {
if (added_display_observer_)
Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
@@ -269,6 +277,15 @@ void WmShellAura::InitHosts(const ShellInitParams& init_params) {
Shell::GetInstance()->window_tree_host_manager()->InitHosts();
}
+std::unique_ptr<AcceleratorController>
+WmShellAura::CreateAcceleratorController() {
+ DCHECK(!accelerator_controller_delegate_);
+ accelerator_controller_delegate_ =
+ base::MakeUnique<AcceleratorControllerDelegateAura>();
+ return base::MakeUnique<AcceleratorController>(
+ accelerator_controller_delegate_.get(), nullptr);
+}
+
void WmShellAura::SessionStateChanged(session_manager::SessionState state) {
// Create the shelf if necessary.
WmShell::SessionStateChanged(state);
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/accelerators/accelerator_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698