| 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/common/wm_shell.h" | 5 #include "ash/common/wm_shell.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/accelerators/ash_focus_manager_factory.h" | 10 #include "ash/common/accelerators/ash_focus_manager_factory.h" |
| 11 #include "ash/common/accessibility_delegate.h" | 11 #include "ash/common/accessibility_delegate.h" |
| 12 #include "ash/common/focus_cycler.h" | 12 #include "ash/common/focus_cycler.h" |
| 13 #include "ash/common/keyboard/keyboard_ui.h" | 13 #include "ash/common/keyboard/keyboard_ui.h" |
| 14 #include "ash/common/new_window_delegate.h" | 14 #include "ash/common/new_window_delegate.h" |
| 15 #include "ash/common/palette_delegate.h" |
| 15 #include "ash/common/session/session_state_delegate.h" | 16 #include "ash/common/session/session_state_delegate.h" |
| 16 #include "ash/common/shelf/app_list_shelf_item_delegate.h" | 17 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |
| 17 #include "ash/common/shelf/shelf_delegate.h" | 18 #include "ash/common/shelf/shelf_delegate.h" |
| 18 #include "ash/common/shelf/shelf_model.h" | 19 #include "ash/common/shelf/shelf_model.h" |
| 19 #include "ash/common/shelf/shelf_window_watcher.h" | 20 #include "ash/common/shelf/shelf_window_watcher.h" |
| 20 #include "ash/common/shell_delegate.h" | 21 #include "ash/common/shell_delegate.h" |
| 21 #include "ash/common/shell_window_ids.h" | 22 #include "ash/common/shell_window_ids.h" |
| 22 #include "ash/common/system/brightness_control_delegate.h" | 23 #include "ash/common/system/brightness_control_delegate.h" |
| 23 #include "ash/common/system/keyboard_brightness_control_delegate.h" | 24 #include "ash/common/system/keyboard_brightness_control_delegate.h" |
| 24 #include "ash/common/system/toast/toast_manager.h" | 25 #include "ash/common/system/toast/toast_manager.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 54 // static | 55 // static |
| 55 WmShell* WmShell::Get() { | 56 WmShell* WmShell::Get() { |
| 56 return instance_; | 57 return instance_; |
| 57 } | 58 } |
| 58 | 59 |
| 59 void WmShell::Initialize() { | 60 void WmShell::Initialize() { |
| 60 // Some delegates access WmShell during their construction. Create them here | 61 // Some delegates access WmShell during their construction. Create them here |
| 61 // instead of the WmShell constructor. | 62 // instead of the WmShell constructor. |
| 62 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); | 63 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); |
| 63 media_delegate_.reset(delegate_->CreateMediaDelegate()); | 64 media_delegate_.reset(delegate_->CreateMediaDelegate()); |
| 65 palette_delegate_ = delegate_->CreatePaletteDelegate(); |
| 64 toast_manager_.reset(new ToastManager); | 66 toast_manager_.reset(new ToastManager); |
| 65 | 67 |
| 66 // Create the app list item in the shelf data model. | 68 // Create the app list item in the shelf data model. |
| 67 AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model_.get()); | 69 AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model_.get()); |
| 68 | 70 |
| 69 // Install the custom factory early on so that views::FocusManagers for Tray, | 71 // Install the custom factory early on so that views::FocusManagers for Tray, |
| 70 // Shelf, and WallPaper could be created by the factory. | 72 // Shelf, and WallPaper could be created by the factory. |
| 71 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 73 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
| 72 | 74 |
| 73 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); | 75 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 void WmShell::DeleteToastManager() { | 267 void WmShell::DeleteToastManager() { |
| 266 toast_manager_.reset(); | 268 toast_manager_.reset(); |
| 267 } | 269 } |
| 268 | 270 |
| 269 void WmShell::SetAcceleratorController( | 271 void WmShell::SetAcceleratorController( |
| 270 std::unique_ptr<AcceleratorController> accelerator_controller) { | 272 std::unique_ptr<AcceleratorController> accelerator_controller) { |
| 271 accelerator_controller_ = std::move(accelerator_controller); | 273 accelerator_controller_ = std::move(accelerator_controller); |
| 272 } | 274 } |
| 273 | 275 |
| 274 } // namespace ash | 276 } // namespace ash |
| OLD | NEW |