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

Unified Diff: ash/mus/bridge/wm_shell_mus.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/mus/bridge/wm_shell_mus.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/bridge/wm_shell_mus.cc
diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
index 4d72c9026b409cb153f21e4c1a3e96f3e295d430..8c1479cd833e37aa71babb35db4bd3988a72b9bf 100644
--- a/ash/mus/bridge/wm_shell_mus.cc
+++ b/ash/mus/bridge/wm_shell_mus.cc
@@ -125,18 +125,6 @@ WmShellMus::WmShellMus(
session_state_delegate_ = base::MakeUnique<SessionStateDelegateStub>();
DCHECK(primary_root_window_);
- uint16_t accelerator_namespace_id = 0u;
- const bool add_result =
- window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id);
- // WmShellMus is created early on, so that this should always succeed.
- DCHECK(add_result);
- accelerator_controller_delegate_.reset(
- new AcceleratorControllerDelegateMus(window_manager_));
- accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar(
- window_manager_, accelerator_namespace_id));
- SetAcceleratorController(base::MakeUnique<AcceleratorController>(
- accelerator_controller_delegate_.get(),
- accelerator_controller_registrar_.get()));
immersive_handler_factory_.reset(new ImmersiveHandlerFactoryMus);
SetKeyboardUI(KeyboardUIMus::Create(window_manager_->connector()));
@@ -395,5 +383,26 @@ void WmShellMus::InitHosts(const ShellInitParams& init_params) {
window_manager_->CreatePrimaryRootWindowController(
base::WrapUnique(init_params.primary_window_tree_host));
}
+
+std::unique_ptr<AcceleratorController>
+WmShellMus::CreateAcceleratorController() {
+ DCHECK(!accelerator_controller_delegate_);
+ uint16_t accelerator_namespace_id = 0u;
+ const bool add_result =
+ window_manager_->GetNextAcceleratorNamespaceId(&accelerator_namespace_id);
+ // WmShellMus is created early on, so that GetNextAcceleratorNamespaceId()
+ // should always succeed.
+ DCHECK(add_result);
+
+ accelerator_controller_delegate_ =
+ base::MakeUnique<AcceleratorControllerDelegateMus>(window_manager_);
+ accelerator_controller_registrar_ =
+ base ::MakeUnique<AcceleratorControllerRegistrar>(
+ window_manager_, accelerator_namespace_id);
+ return base::MakeUnique<AcceleratorController>(
+ accelerator_controller_delegate_.get(),
+ accelerator_controller_registrar_.get());
+}
+
} // namespace mus
} // namespace ash
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698