OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "ash/sticky_keys/sticky_keys_controller.h" | 66 #include "ash/sticky_keys/sticky_keys_controller.h" |
67 #include "ash/system/bluetooth/bluetooth_notification_controller.h" | 67 #include "ash/system/bluetooth/bluetooth_notification_controller.h" |
68 #include "ash/system/bluetooth/tray_bluetooth_helper.h" | 68 #include "ash/system/bluetooth/tray_bluetooth_helper.h" |
69 #include "ash/system/brightness/brightness_controller_chromeos.h" | 69 #include "ash/system/brightness/brightness_controller_chromeos.h" |
70 #include "ash/system/brightness_control_delegate.h" | 70 #include "ash/system/brightness_control_delegate.h" |
71 #include "ash/system/keyboard_brightness_control_delegate.h" | 71 #include "ash/system/keyboard_brightness_control_delegate.h" |
72 #include "ash/system/keyboard_brightness_controller.h" | 72 #include "ash/system/keyboard_brightness_controller.h" |
73 #include "ash/system/locale/locale_notification_controller.h" | 73 #include "ash/system/locale/locale_notification_controller.h" |
74 #include "ash/system/network/sms_observer.h" | 74 #include "ash/system/network/sms_observer.h" |
75 #include "ash/system/network/vpn_list.h" | 75 #include "ash/system/network/vpn_list.h" |
| 76 #include "ash/system/night_light/night_light_controller.h" |
76 #include "ash/system/power/power_event_observer.h" | 77 #include "ash/system/power/power_event_observer.h" |
77 #include "ash/system/power/power_status.h" | 78 #include "ash/system/power/power_status.h" |
78 #include "ash/system/power/video_activity_notifier.h" | 79 #include "ash/system/power/video_activity_notifier.h" |
79 #include "ash/system/screen_layout_observer.h" | 80 #include "ash/system/screen_layout_observer.h" |
80 #include "ash/system/session/logout_confirmation_controller.h" | 81 #include "ash/system/session/logout_confirmation_controller.h" |
81 #include "ash/system/status_area_widget.h" | 82 #include "ash/system/status_area_widget.h" |
82 #include "ash/system/toast/toast_manager.h" | 83 #include "ash/system/toast/toast_manager.h" |
83 #include "ash/system/tray/system_tray_controller.h" | 84 #include "ash/system/tray/system_tray_controller.h" |
84 #include "ash/system/tray/system_tray_delegate.h" | 85 #include "ash/system/tray/system_tray_delegate.h" |
85 #include "ash/system/tray/system_tray_notifier.h" | 86 #include "ash/system/tray/system_tray_notifier.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 const aura::Window* Shell::GetContainer(const aura::Window* root_window, | 303 const aura::Window* Shell::GetContainer(const aura::Window* root_window, |
303 int container_id) { | 304 int container_id) { |
304 return root_window->GetChildById(container_id); | 305 return root_window->GetChildById(container_id); |
305 } | 306 } |
306 | 307 |
307 // static | 308 // static |
308 Config Shell::GetAshConfig() { | 309 Config Shell::GetAshConfig() { |
309 return Get()->shell_port_->GetAshConfig(); | 310 return Get()->shell_port_->GetAshConfig(); |
310 } | 311 } |
311 | 312 |
| 313 // static |
| 314 void Shell::RegisterPrefs(PrefRegistrySimple* registry) { |
| 315 NightLightController::RegisterPrefs(registry); |
| 316 } |
| 317 |
312 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 318 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
313 views::Widget* widget) { | 319 views::Widget* widget) { |
314 // Use translucent-style window frames for dialogs. | 320 // Use translucent-style window frames for dialogs. |
315 return new CustomFrameViewAsh(widget); | 321 return new CustomFrameViewAsh(widget); |
316 } | 322 } |
317 | 323 |
318 void Shell::SetDisplayWorkAreaInsets(Window* contains, | 324 void Shell::SetDisplayWorkAreaInsets(Window* contains, |
319 const gfx::Insets& insets) { | 325 const gfx::Insets& insets) { |
320 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); | 326 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); |
321 } | 327 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 cast_config_(base::MakeUnique<CastConfigController>()), | 551 cast_config_(base::MakeUnique<CastConfigController>()), |
546 focus_cycler_(base::MakeUnique<FocusCycler>()), | 552 focus_cycler_(base::MakeUnique<FocusCycler>()), |
547 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), | 553 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), |
548 keyboard_brightness_control_delegate_( | 554 keyboard_brightness_control_delegate_( |
549 base::MakeUnique<KeyboardBrightnessController>()), | 555 base::MakeUnique<KeyboardBrightnessController>()), |
550 locale_notification_controller_( | 556 locale_notification_controller_( |
551 base::MakeUnique<LocaleNotificationController>()), | 557 base::MakeUnique<LocaleNotificationController>()), |
552 media_controller_(base::MakeUnique<MediaController>()), | 558 media_controller_(base::MakeUnique<MediaController>()), |
553 new_window_controller_(base::MakeUnique<NewWindowController>()), | 559 new_window_controller_(base::MakeUnique<NewWindowController>()), |
554 session_controller_(base::MakeUnique<SessionController>()), | 560 session_controller_(base::MakeUnique<SessionController>()), |
| 561 night_light_controller_( |
| 562 base::MakeUnique<NightLightController>(session_controller_.get())), |
555 shelf_controller_(base::MakeUnique<ShelfController>()), | 563 shelf_controller_(base::MakeUnique<ShelfController>()), |
556 shell_delegate_(std::move(shell_delegate)), | 564 shell_delegate_(std::move(shell_delegate)), |
557 shutdown_controller_(base::MakeUnique<ShutdownController>()), | 565 shutdown_controller_(base::MakeUnique<ShutdownController>()), |
558 system_tray_controller_(base::MakeUnique<SystemTrayController>()), | 566 system_tray_controller_(base::MakeUnique<SystemTrayController>()), |
559 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), | 567 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), |
560 vpn_list_(base::MakeUnique<VpnList>()), | 568 vpn_list_(base::MakeUnique<VpnList>()), |
561 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), | 569 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), |
562 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), | 570 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), |
563 app_list_(base::MakeUnique<app_list::AppList>()), | 571 app_list_(base::MakeUnique<app_list::AppList>()), |
564 link_handler_model_factory_(nullptr), | 572 link_handler_model_factory_(nullptr), |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 void Shell::OnPrefServiceInitialized( | 1249 void Shell::OnPrefServiceInitialized( |
1242 std::unique_ptr<::PrefService> pref_service) { | 1250 std::unique_ptr<::PrefService> pref_service) { |
1243 if (!instance_) | 1251 if (!instance_) |
1244 return; | 1252 return; |
1245 // |pref_service_| is null if can't connect to Chrome (as happens when | 1253 // |pref_service_| is null if can't connect to Chrome (as happens when |
1246 // running mash outside of chrome --mash and chrome isn't built). | 1254 // running mash outside of chrome --mash and chrome isn't built). |
1247 pref_service_ = std::move(pref_service); | 1255 pref_service_ = std::move(pref_service); |
1248 } | 1256 } |
1249 | 1257 |
1250 } // namespace ash | 1258 } // namespace ash |
OLD | NEW |