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/sysui/sysui_application.h" | 5 #include "ash/sysui/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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 std::unique_ptr<NativeWidgetFactory> native_widget_factory_; | 306 std::unique_ptr<NativeWidgetFactory> native_widget_factory_; |
307 std::unique_ptr<views::WindowManagerConnection> window_manager_connection_; | 307 std::unique_ptr<views::WindowManagerConnection> window_manager_connection_; |
308 | 308 |
309 DISALLOW_COPY_AND_ASSIGN(AshInit); | 309 DISALLOW_COPY_AND_ASSIGN(AshInit); |
310 }; | 310 }; |
311 | 311 |
312 SysUIApplication::SysUIApplication() {} | 312 SysUIApplication::SysUIApplication() {} |
313 | 313 |
314 SysUIApplication::~SysUIApplication() {} | 314 SysUIApplication::~SysUIApplication() {} |
315 | 315 |
316 void SysUIApplication::OnStart(::shell::Connector* connector, | 316 void SysUIApplication::OnStart(const ::shell::Identity& identity) { |
317 const ::shell::Identity& identity, | |
318 uint32_t id) { | |
319 ash_init_.reset(new AshInit()); | 317 ash_init_.reset(new AshInit()); |
320 ash_init_->Initialize(connector, identity); | 318 ash_init_->Initialize(connector(), identity); |
321 | 319 |
322 ui::mojom::InputDeviceServerPtr server; | 320 ui::mojom::InputDeviceServerPtr server; |
323 connector->ConnectToInterface("mojo:ui", &server); | 321 connector()->ConnectToInterface("mojo:ui", &server); |
324 input_device_client_.Connect(std::move(server)); | 322 input_device_client_.Connect(std::move(server)); |
325 } | 323 } |
326 | 324 |
327 bool SysUIApplication::OnConnect(::shell::Connection* connection) { | 325 bool SysUIApplication::OnConnect(::shell::Connection* connection) { |
328 connection->AddInterface<mash::shelf::mojom::ShelfController>(this); | 326 connection->AddInterface<mash::shelf::mojom::ShelfController>(this); |
329 connection->AddInterface<mojom::WallpaperController>(this); | 327 connection->AddInterface<mojom::WallpaperController>(this); |
330 return true; | 328 return true; |
331 } | 329 } |
332 | 330 |
333 void SysUIApplication::Create( | 331 void SysUIApplication::Create( |
334 const ::shell::Identity& remote_identity, | 332 const ::shell::Identity& remote_identity, |
335 mash::shelf::mojom::ShelfControllerRequest request) { | 333 mash::shelf::mojom::ShelfControllerRequest request) { |
336 mash::shelf::mojom::ShelfController* shelf_controller = | 334 mash::shelf::mojom::ShelfController* shelf_controller = |
337 static_cast<ShelfDelegateMus*>(WmShell::Get()->shelf_delegate()); | 335 static_cast<ShelfDelegateMus*>(WmShell::Get()->shelf_delegate()); |
338 DCHECK(shelf_controller); | 336 DCHECK(shelf_controller); |
339 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); | 337 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); |
340 } | 338 } |
341 | 339 |
342 void SysUIApplication::Create(const ::shell::Identity& remote_identity, | 340 void SysUIApplication::Create(const ::shell::Identity& remote_identity, |
343 mojom::WallpaperControllerRequest request) { | 341 mojom::WallpaperControllerRequest request) { |
344 mojom::WallpaperController* wallpaper_controller = | 342 mojom::WallpaperController* wallpaper_controller = |
345 static_cast<UserWallpaperDelegateMus*>( | 343 static_cast<UserWallpaperDelegateMus*>( |
346 Shell::GetInstance()->user_wallpaper_delegate()); | 344 Shell::GetInstance()->user_wallpaper_delegate()); |
347 wallpaper_controller_bindings_.AddBinding(wallpaper_controller, | 345 wallpaper_controller_bindings_.AddBinding(wallpaper_controller, |
348 std::move(request)); | 346 std::move(request)); |
349 } | 347 } |
350 | 348 |
351 } // namespace sysui | 349 } // namespace sysui |
352 } // namespace ash | 350 } // namespace ash |
OLD | NEW |