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" |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "ash/common/wm/overview/window_selector_controller.h" | 37 #include "ash/common/wm/overview/window_selector_controller.h" |
38 #include "ash/common/wm/root_window_finder.h" | 38 #include "ash/common/wm/root_window_finder.h" |
39 #include "ash/common/wm/system_modal_container_layout_manager.h" | 39 #include "ash/common/wm/system_modal_container_layout_manager.h" |
40 #include "ash/common/wm/window_cycle_controller.h" | 40 #include "ash/common/wm/window_cycle_controller.h" |
41 #include "ash/common/wm_root_window_controller.h" | 41 #include "ash/common/wm_root_window_controller.h" |
42 #include "ash/common/wm_window.h" | 42 #include "ash/common/wm_window.h" |
43 #include "ash/public/cpp/shell_window_ids.h" | 43 #include "ash/public/cpp/shell_window_ids.h" |
44 #include "base/bind.h" | 44 #include "base/bind.h" |
45 #include "base/logging.h" | 45 #include "base/logging.h" |
46 #include "base/memory/ptr_util.h" | 46 #include "base/memory/ptr_util.h" |
| 47 #include "services/preferences/public/cpp/pref_observer_store.h" |
| 48 #include "services/service_manager/public/cpp/connector.h" |
47 #include "ui/app_list/presenter/app_list_presenter.h" | 49 #include "ui/app_list/presenter/app_list_presenter.h" |
48 #include "ui/display/display.h" | 50 #include "ui/display/display.h" |
49 #include "ui/views/focus/focus_manager_factory.h" | 51 #include "ui/views/focus/focus_manager_factory.h" |
50 | 52 |
51 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
52 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h
" | 54 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h
" |
53 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" | 55 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" |
54 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" | 56 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" |
55 #endif | 57 #endif |
56 | 58 |
| 59 namespace { |
| 60 |
| 61 PrefObserverStore* CreatePrefObserverStore( |
| 62 service_manager::Connector* connector) { |
| 63 prefs::mojom::PreferencesManagerPtr pref_manager_ptr; |
| 64 connector->ConnectToInterface("content_browser", &pref_manager_ptr); |
| 65 return new PrefObserverStore(std::move(pref_manager_ptr)); |
| 66 } |
| 67 |
| 68 } // namespace |
| 69 |
57 namespace ash { | 70 namespace ash { |
58 | 71 |
59 // static | 72 // static |
60 WmShell* WmShell::instance_ = nullptr; | 73 WmShell* WmShell::instance_ = nullptr; |
61 | 74 |
62 // static | 75 // static |
63 void WmShell::Set(WmShell* instance) { | 76 void WmShell::Set(WmShell* instance) { |
64 instance_ = instance; | 77 instance_ = instance; |
65 } | 78 } |
66 | 79 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 254 } |
242 | 255 |
243 WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate) | 256 WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate) |
244 : delegate_(std::move(shell_delegate)), | 257 : delegate_(std::move(shell_delegate)), |
245 focus_cycler_(base::MakeUnique<FocusCycler>()), | 258 focus_cycler_(base::MakeUnique<FocusCycler>()), |
246 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), | 259 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), |
247 locale_notification_controller_( | 260 locale_notification_controller_( |
248 base::MakeUnique<LocaleNotificationController>()), | 261 base::MakeUnique<LocaleNotificationController>()), |
249 new_window_client_(base::MakeUnique<NewWindowClientProxy>( | 262 new_window_client_(base::MakeUnique<NewWindowClientProxy>( |
250 delegate_->GetShellConnector())), | 263 delegate_->GetShellConnector())), |
| 264 pref_observer_store_( |
| 265 CreatePrefObserverStore(delegate_->GetShellConnector())), |
251 shelf_controller_(base::MakeUnique<ShelfController>()), | 266 shelf_controller_(base::MakeUnique<ShelfController>()), |
252 shutdown_controller_(base::MakeUnique<ShutdownController>()), | 267 shutdown_controller_(base::MakeUnique<ShutdownController>()), |
253 system_tray_controller_(base::MakeUnique<SystemTrayController>( | 268 system_tray_controller_(base::MakeUnique<SystemTrayController>( |
254 delegate_->GetShellConnector())), | 269 delegate_->GetShellConnector())), |
255 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), | 270 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), |
256 wallpaper_delegate_(delegate_->CreateWallpaperDelegate()), | 271 wallpaper_delegate_(delegate_->CreateWallpaperDelegate()), |
257 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), | 272 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), |
258 window_selector_controller_( | 273 window_selector_controller_( |
259 base::MakeUnique<WindowSelectorController>()) { | 274 base::MakeUnique<WindowSelectorController>()) { |
260 #if defined(OS_CHROMEOS) | 275 #if defined(OS_CHROMEOS) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 void WmShell::DeleteToastManager() { | 413 void WmShell::DeleteToastManager() { |
399 toast_manager_.reset(); | 414 toast_manager_.reset(); |
400 } | 415 } |
401 | 416 |
402 void WmShell::SetAcceleratorController( | 417 void WmShell::SetAcceleratorController( |
403 std::unique_ptr<AcceleratorController> accelerator_controller) { | 418 std::unique_ptr<AcceleratorController> accelerator_controller) { |
404 accelerator_controller_ = std::move(accelerator_controller); | 419 accelerator_controller_ = std::move(accelerator_controller); |
405 } | 420 } |
406 | 421 |
407 } // namespace ash | 422 } // namespace ash |
OLD | NEW |