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

Side by Side Diff: ash/mus/sysui_application.cc

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
Patch Set: . Created 4 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
« no previous file with comments | « ash/mus/sysui_application.h ('k') | chrome/app/mash/mash_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/sysui_application.h" 5 #include "ash/mus/sysui_application.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h" 7 #include "ash/desktop_background/desktop_background_controller.h"
8 #include "ash/host/ash_window_tree_host_init_params.h" 8 #include "ash/host/ash_window_tree_host_init_params.h"
9 #include "ash/host/ash_window_tree_host_platform.h" 9 #include "ash/host/ash_window_tree_host_platform.h"
10 #include "ash/mus/keyboard_ui_mus.h" 10 #include "ash/mus/keyboard_ui_mus.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 public: 167 public:
168 AshInit() : worker_pool_(new base::SequencedWorkerPool(2, "AshWorkerPool")) { 168 AshInit() : worker_pool_(new base::SequencedWorkerPool(2, "AshWorkerPool")) {
169 ui::RegisterPathProvider(); 169 ui::RegisterPathProvider();
170 InitializeResourceBundle(); 170 InitializeResourceBundle();
171 } 171 }
172 172
173 ~AshInit() { worker_pool_->Shutdown(); } 173 ~AshInit() { worker_pool_->Shutdown(); }
174 174
175 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); } 175 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); }
176 176
177 void Initialize(mojo::Shell* shell) { 177 void Initialize(mojo::Connector* connector) {
178 aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak")); 178 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak"));
179 views::WindowManagerConnection::Create(shell); 179 views::WindowManagerConnection::Create(connector);
180 180
181 gfx::Screen* screen = gfx::Screen::GetScreen(); 181 gfx::Screen* screen = gfx::Screen::GetScreen();
182 DCHECK(screen); 182 DCHECK(screen);
183 gfx::Size size = screen->GetPrimaryDisplay().bounds().size(); 183 gfx::Size size = screen->GetPrimaryDisplay().bounds().size();
184 184
185 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash 185 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash
186 // installs and uses the ScreenAsh. This can be removed once ash learns to 186 // installs and uses the ScreenAsh. This can be removed once ash learns to
187 // talk to mus for managing displays. 187 // talk to mus for managing displays.
188 gfx::Screen::SetScreenInstance(nullptr); 188 gfx::Screen::SetScreenInstance(nullptr);
189 189
190 // Install some hook so that the WindowTreeHostMus created for widgets can 190 // Install some hook so that the WindowTreeHostMus created for widgets can
191 // be hooked up correctly. 191 // be hooked up correctly.
192 native_widget_factory_.reset(new NativeWidgetFactory()); 192 native_widget_factory_.reset(new NativeWidgetFactory());
193 193
194 ash::AshWindowTreeHost::SetFactory(base::Bind(&CreateWindowTreeHostMus)); 194 ash::AshWindowTreeHost::SetFactory(base::Bind(&CreateWindowTreeHostMus));
195 ash_delegate_ = new ShellDelegateMus; 195 ash_delegate_ = new ShellDelegateMus;
196 196
197 InitializeComponents(); 197 InitializeComponents();
198 198
199 ash::ShellInitParams init_params; 199 ash::ShellInitParams init_params;
200 init_params.delegate = ash_delegate_; 200 init_params.delegate = ash_delegate_;
201 init_params.context_factory = new StubContextFactory; 201 init_params.context_factory = new StubContextFactory;
202 init_params.blocking_pool = worker_pool_.get(); 202 init_params.blocking_pool = worker_pool_.get();
203 init_params.in_mus = true; 203 init_params.in_mus = true;
204 init_params.keyboard_factory = base::Bind(&KeyboardUIMus::Create, shell); 204 init_params.keyboard_factory =
205 base::Bind(&KeyboardUIMus::Create, connector);
205 ash::Shell::CreateInstance(init_params); 206 ash::Shell::CreateInstance(init_params);
206 ash::Shell::GetInstance()->CreateShelf(); 207 ash::Shell::GetInstance()->CreateShelf();
207 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange( 208 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(
208 ash::user::LOGGED_IN_USER); 209 ash::user::LOGGED_IN_USER);
209 210
210 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); 211 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
211 SetupWallpaper(SkColorSetARGB(255, 0, 255, 0)); 212 SetupWallpaper(SkColorSetARGB(255, 0, 255, 0));
212 } 213 }
213 214
214 void InitializeResourceBundle() { 215 void InitializeResourceBundle() {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 ShellDelegateMus* ash_delegate_ = nullptr; 270 ShellDelegateMus* ash_delegate_ = nullptr;
270 scoped_ptr<NativeWidgetFactory> native_widget_factory_; 271 scoped_ptr<NativeWidgetFactory> native_widget_factory_;
271 272
272 DISALLOW_COPY_AND_ASSIGN(AshInit); 273 DISALLOW_COPY_AND_ASSIGN(AshInit);
273 }; 274 };
274 275
275 SysUIApplication::SysUIApplication() {} 276 SysUIApplication::SysUIApplication() {}
276 277
277 SysUIApplication::~SysUIApplication() {} 278 SysUIApplication::~SysUIApplication() {}
278 279
279 void SysUIApplication::Initialize(mojo::Shell* shell, 280 void SysUIApplication::Initialize(mojo::Connector* connector,
280 const std::string& url, 281 const std::string& url,
281 uint32_t id, 282 uint32_t id,
282 uint32_t user_id) { 283 uint32_t user_id) {
283 ash_init_.reset(new AshInit()); 284 ash_init_.reset(new AshInit());
284 ash_init_->Initialize(shell); 285 ash_init_->Initialize(connector);
285 } 286 }
286 287
287 bool SysUIApplication::AcceptConnection(mojo::Connection* connection) { 288 bool SysUIApplication::AcceptConnection(mojo::Connection* connection) {
288 return true; 289 return true;
289 } 290 }
290 291
291 } // namespace sysui 292 } // namespace sysui
292 } // namespace ash 293 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/sysui_application.h ('k') | chrome/app/mash/mash_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698