| OLD | NEW |
| 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 class AshInit { | 186 class AshInit { |
| 187 public: | 187 public: |
| 188 AshInit() : worker_pool_(new base::SequencedWorkerPool(2, "AshWorkerPool")) { | 188 AshInit() : worker_pool_(new base::SequencedWorkerPool(2, "AshWorkerPool")) { |
| 189 ui::RegisterPathProvider(); | 189 ui::RegisterPathProvider(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 ~AshInit() { worker_pool_->Shutdown(); } | 192 ~AshInit() { worker_pool_->Shutdown(); } |
| 193 | 193 |
| 194 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); } | 194 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); } |
| 195 | 195 |
| 196 void Initialize(::shell::Connector* connector) { | 196 void Initialize(::shell::Connector* connector, |
| 197 const ::shell::Identity& identity) { |
| 197 InitializeResourceBundle(connector); | 198 InitializeResourceBundle(connector); |
| 198 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); | 199 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); |
| 199 views::WindowManagerConnection::Create(connector); | 200 views::WindowManagerConnection::Create(connector, identity); |
| 200 | 201 |
| 201 gfx::Screen* screen = gfx::Screen::GetScreen(); | 202 gfx::Screen* screen = gfx::Screen::GetScreen(); |
| 202 DCHECK(screen); | 203 DCHECK(screen); |
| 203 gfx::Size size = screen->GetPrimaryDisplay().bounds().size(); | 204 gfx::Size size = screen->GetPrimaryDisplay().bounds().size(); |
| 204 | 205 |
| 205 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash | 206 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash |
| 206 // installs and uses the ScreenAsh. This can be removed once ash learns to | 207 // installs and uses the ScreenAsh. This can be removed once ash learns to |
| 207 // talk to mus for managing displays. | 208 // talk to mus for managing displays. |
| 208 gfx::Screen::SetScreenInstance(nullptr); | 209 gfx::Screen::SetScreenInstance(nullptr); |
| 209 | 210 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 }; | 300 }; |
| 300 | 301 |
| 301 SysUIApplication::SysUIApplication() {} | 302 SysUIApplication::SysUIApplication() {} |
| 302 | 303 |
| 303 SysUIApplication::~SysUIApplication() {} | 304 SysUIApplication::~SysUIApplication() {} |
| 304 | 305 |
| 305 void SysUIApplication::Initialize(::shell::Connector* connector, | 306 void SysUIApplication::Initialize(::shell::Connector* connector, |
| 306 const ::shell::Identity& identity, | 307 const ::shell::Identity& identity, |
| 307 uint32_t id) { | 308 uint32_t id) { |
| 308 ash_init_.reset(new AshInit()); | 309 ash_init_.reset(new AshInit()); |
| 309 ash_init_->Initialize(connector); | 310 ash_init_->Initialize(connector, identity); |
| 310 } | 311 } |
| 311 | 312 |
| 312 bool SysUIApplication::AcceptConnection(::shell::Connection* connection) { | 313 bool SysUIApplication::AcceptConnection(::shell::Connection* connection) { |
| 313 connection->AddInterface<mash::shelf::mojom::ShelfController>(this); | 314 connection->AddInterface<mash::shelf::mojom::ShelfController>(this); |
| 314 return true; | 315 return true; |
| 315 } | 316 } |
| 316 | 317 |
| 317 void SysUIApplication::Create( | 318 void SysUIApplication::Create( |
| 318 ::shell::Connection* connection, | 319 ::shell::Connection* connection, |
| 319 mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) { | 320 mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) { |
| 320 mash::shelf::mojom::ShelfController* shelf_controller = | 321 mash::shelf::mojom::ShelfController* shelf_controller = |
| 321 static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate()); | 322 static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate()); |
| 322 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); | 323 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); |
| 323 } | 324 } |
| 324 | 325 |
| 325 } // namespace sysui | 326 } // namespace sysui |
| 326 } // namespace ash | 327 } // namespace ash |
| OLD | NEW |