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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "ash/sticky_keys/sticky_keys_controller.h" | 67 #include "ash/sticky_keys/sticky_keys_controller.h" |
68 #include "ash/system/bluetooth/bluetooth_notification_controller.h" | 68 #include "ash/system/bluetooth/bluetooth_notification_controller.h" |
69 #include "ash/system/bluetooth/tray_bluetooth_helper.h" | 69 #include "ash/system/bluetooth/tray_bluetooth_helper.h" |
70 #include "ash/system/brightness/brightness_controller_chromeos.h" | 70 #include "ash/system/brightness/brightness_controller_chromeos.h" |
71 #include "ash/system/brightness_control_delegate.h" | 71 #include "ash/system/brightness_control_delegate.h" |
72 #include "ash/system/keyboard_brightness_control_delegate.h" | 72 #include "ash/system/keyboard_brightness_control_delegate.h" |
73 #include "ash/system/keyboard_brightness_controller.h" | 73 #include "ash/system/keyboard_brightness_controller.h" |
74 #include "ash/system/locale/locale_notification_controller.h" | 74 #include "ash/system/locale/locale_notification_controller.h" |
75 #include "ash/system/network/sms_observer.h" | 75 #include "ash/system/network/sms_observer.h" |
76 #include "ash/system/network/vpn_list.h" | 76 #include "ash/system/network/vpn_list.h" |
| 77 #include "ash/system/night_light/night_light_controller.h" |
77 #include "ash/system/power/power_event_observer.h" | 78 #include "ash/system/power/power_event_observer.h" |
78 #include "ash/system/power/power_status.h" | 79 #include "ash/system/power/power_status.h" |
79 #include "ash/system/power/video_activity_notifier.h" | 80 #include "ash/system/power/video_activity_notifier.h" |
80 #include "ash/system/screen_layout_observer.h" | 81 #include "ash/system/screen_layout_observer.h" |
81 #include "ash/system/session/logout_confirmation_controller.h" | 82 #include "ash/system/session/logout_confirmation_controller.h" |
82 #include "ash/system/status_area_widget.h" | 83 #include "ash/system/status_area_widget.h" |
83 #include "ash/system/toast/toast_manager.h" | 84 #include "ash/system/toast/toast_manager.h" |
84 #include "ash/system/tray/system_tray_controller.h" | 85 #include "ash/system/tray/system_tray_controller.h" |
85 #include "ash/system/tray/system_tray_delegate.h" | 86 #include "ash/system/tray/system_tray_delegate.h" |
86 #include "ash/system/tray/system_tray_notifier.h" | 87 #include "ash/system/tray/system_tray_notifier.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 312 } |
312 | 313 |
313 // static | 314 // static |
314 bool Shell::ShouldUseIMEService() { | 315 bool Shell::ShouldUseIMEService() { |
315 return Shell::GetAshConfig() == Config::MASH || | 316 return Shell::GetAshConfig() == Config::MASH || |
316 (Shell::GetAshConfig() == Config::MUS && | 317 (Shell::GetAshConfig() == Config::MUS && |
317 base::CommandLine::ForCurrentProcess()->HasSwitch( | 318 base::CommandLine::ForCurrentProcess()->HasSwitch( |
318 switches::kUseIMEService)); | 319 switches::kUseIMEService)); |
319 } | 320 } |
320 | 321 |
| 322 // static |
| 323 void Shell::RegisterPrefs(PrefRegistrySimple* registry) { |
| 324 NightLightController::RegisterPrefs(registry); |
| 325 } |
| 326 |
321 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 327 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
322 views::Widget* widget) { | 328 views::Widget* widget) { |
323 // Use translucent-style window frames for dialogs. | 329 // Use translucent-style window frames for dialogs. |
324 return new CustomFrameViewAsh(widget); | 330 return new CustomFrameViewAsh(widget); |
325 } | 331 } |
326 | 332 |
327 void Shell::SetDisplayWorkAreaInsets(Window* contains, | 333 void Shell::SetDisplayWorkAreaInsets(Window* contains, |
328 const gfx::Insets& insets) { | 334 const gfx::Insets& insets) { |
329 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); | 335 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); |
330 } | 336 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 cast_config_(base::MakeUnique<CastConfigController>()), | 560 cast_config_(base::MakeUnique<CastConfigController>()), |
555 focus_cycler_(base::MakeUnique<FocusCycler>()), | 561 focus_cycler_(base::MakeUnique<FocusCycler>()), |
556 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), | 562 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), |
557 keyboard_brightness_control_delegate_( | 563 keyboard_brightness_control_delegate_( |
558 base::MakeUnique<KeyboardBrightnessController>()), | 564 base::MakeUnique<KeyboardBrightnessController>()), |
559 locale_notification_controller_( | 565 locale_notification_controller_( |
560 base::MakeUnique<LocaleNotificationController>()), | 566 base::MakeUnique<LocaleNotificationController>()), |
561 media_controller_(base::MakeUnique<MediaController>()), | 567 media_controller_(base::MakeUnique<MediaController>()), |
562 new_window_controller_(base::MakeUnique<NewWindowController>()), | 568 new_window_controller_(base::MakeUnique<NewWindowController>()), |
563 session_controller_(base::MakeUnique<SessionController>()), | 569 session_controller_(base::MakeUnique<SessionController>()), |
| 570 night_light_controller_( |
| 571 base::MakeUnique<NightLightController>(session_controller_.get())), |
564 shelf_controller_(base::MakeUnique<ShelfController>()), | 572 shelf_controller_(base::MakeUnique<ShelfController>()), |
565 shell_delegate_(std::move(shell_delegate)), | 573 shell_delegate_(std::move(shell_delegate)), |
566 shutdown_controller_(base::MakeUnique<ShutdownController>()), | 574 shutdown_controller_(base::MakeUnique<ShutdownController>()), |
567 system_tray_controller_(base::MakeUnique<SystemTrayController>()), | 575 system_tray_controller_(base::MakeUnique<SystemTrayController>()), |
568 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), | 576 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), |
569 vpn_list_(base::MakeUnique<VpnList>()), | 577 vpn_list_(base::MakeUnique<VpnList>()), |
570 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), | 578 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), |
571 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), | 579 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), |
572 app_list_(base::MakeUnique<app_list::AppList>()), | 580 app_list_(base::MakeUnique<app_list::AppList>()), |
573 link_handler_model_factory_(nullptr), | 581 link_handler_model_factory_(nullptr), |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 void Shell::OnPrefServiceInitialized( | 1261 void Shell::OnPrefServiceInitialized( |
1254 std::unique_ptr<::PrefService> pref_service) { | 1262 std::unique_ptr<::PrefService> pref_service) { |
1255 if (!instance_) | 1263 if (!instance_) |
1256 return; | 1264 return; |
1257 // |pref_service_| is null if can't connect to Chrome (as happens when | 1265 // |pref_service_| is null if can't connect to Chrome (as happens when |
1258 // running mash outside of chrome --mash and chrome isn't built). | 1266 // running mash outside of chrome --mash and chrome isn't built). |
1259 pref_service_ = std::move(pref_service); | 1267 pref_service_ = std::move(pref_service); |
1260 } | 1268 } |
1261 | 1269 |
1262 } // namespace ash | 1270 } // namespace ash |
OLD | NEW |