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

Side by Side Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2741273002: chromeos: Promotes more from WmShell to Shell (Closed)
Patch Set: cleanup 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/mus/bridge/wm_shell_mus.h" 5 #include "ash/mus/bridge/wm_shell_mus.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/key_event_watcher.h" 10 #include "ash/common/key_event_watcher.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // A pseudo user info. 108 // A pseudo user info.
109 std::unique_ptr<user_manager::UserInfo> user_info_; 109 std::unique_ptr<user_manager::UserInfo> user_info_;
110 110
111 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub); 111 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateStub);
112 }; 112 };
113 113
114 } // namespace 114 } // namespace
115 115
116 WmShellMus::WmShellMus( 116 WmShellMus::WmShellMus(
117 WmWindow* primary_root_window, 117 WmWindow* primary_root_window,
118 std::unique_ptr<ShellDelegate> shell_delegate,
119 WindowManager* window_manager, 118 WindowManager* window_manager,
120 views::PointerWatcherEventRouter* pointer_watcher_event_router, 119 views::PointerWatcherEventRouter* pointer_watcher_event_router,
121 bool create_session_state_delegate_stub) 120 bool create_session_state_delegate_stub)
122 : WmShell(std::move(shell_delegate)), 121 : WmShell(),
James Cook 2017/03/11 00:40:43 nit: I don't think this line is needed.
sky 2017/03/13 15:23:19 Done.
123 window_manager_(window_manager), 122 window_manager_(window_manager),
124 primary_root_window_(primary_root_window), 123 primary_root_window_(primary_root_window),
125 pointer_watcher_event_router_(pointer_watcher_event_router) { 124 pointer_watcher_event_router_(pointer_watcher_event_router) {
126 if (create_session_state_delegate_stub) 125 if (create_session_state_delegate_stub)
127 session_state_delegate_ = base::MakeUnique<SessionStateDelegateStub>(); 126 session_state_delegate_ = base::MakeUnique<SessionStateDelegateStub>();
128 DCHECK(primary_root_window_); 127 DCHECK(primary_root_window_);
129 WmShell::Set(this);
130 128
131 uint16_t accelerator_namespace_id = 0u; 129 uint16_t accelerator_namespace_id = 0u;
132 const bool add_result = 130 const bool add_result =
133 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id); 131 window_manager->GetNextAcceleratorNamespaceId(&accelerator_namespace_id);
134 // WmShellMus is created early on, so that this should always succeed. 132 // WmShellMus is created early on, so that this should always succeed.
135 DCHECK(add_result); 133 DCHECK(add_result);
136 accelerator_controller_delegate_.reset( 134 accelerator_controller_delegate_.reset(
137 new AcceleratorControllerDelegateMus(window_manager_)); 135 new AcceleratorControllerDelegateMus(window_manager_));
138 accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar( 136 accelerator_controller_registrar_.reset(new AcceleratorControllerRegistrar(
139 window_manager_, accelerator_namespace_id)); 137 window_manager_, accelerator_namespace_id));
140 SetAcceleratorController(base::MakeUnique<AcceleratorController>( 138 SetAcceleratorController(base::MakeUnique<AcceleratorController>(
141 accelerator_controller_delegate_.get(), 139 accelerator_controller_delegate_.get(),
142 accelerator_controller_registrar_.get())); 140 accelerator_controller_registrar_.get()));
143 immersive_handler_factory_.reset(new ImmersiveHandlerFactoryMus); 141 immersive_handler_factory_.reset(new ImmersiveHandlerFactoryMus);
144 142
145 SetKeyboardUI(KeyboardUIMus::Create(window_manager_->connector())); 143 SetKeyboardUI(KeyboardUIMus::Create(window_manager_->connector()));
146 } 144 }
147 145
148 WmShellMus::~WmShellMus() { 146 WmShellMus::~WmShellMus() {
149 WmShell::Set(nullptr);
150 } 147 }
151 148
152 // static 149 // static
153 WmShellMus* WmShellMus::Get() { 150 WmShellMus* WmShellMus::Get() {
154 return static_cast<WmShellMus*>(WmShell::Get()); 151 return static_cast<WmShellMus*>(WmShell::Get());
155 } 152 }
156 153
157 RootWindowController* WmShellMus::GetRootWindowControllerWithDisplayId( 154 RootWindowController* WmShellMus::GetRootWindowControllerWithDisplayId(
158 int64_t id) { 155 int64_t id) {
159 for (RootWindowController* root_window_controller : 156 for (RootWindowController* root_window_controller :
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 391 }
395 392
396 void WmShellMus::CreatePrimaryHost() {} 393 void WmShellMus::CreatePrimaryHost() {}
397 394
398 void WmShellMus::InitHosts(const ShellInitParams& init_params) { 395 void WmShellMus::InitHosts(const ShellInitParams& init_params) {
399 window_manager_->CreatePrimaryRootWindowController( 396 window_manager_->CreatePrimaryRootWindowController(
400 base::WrapUnique(init_params.primary_window_tree_host)); 397 base::WrapUnique(init_params.primary_window_tree_host));
401 } 398 }
402 } // namespace mus 399 } // namespace mus
403 } // namespace ash 400 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698