Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: ash/shell.cc

Issue 2857103007: [Night Light] CL2: Ash and system tray work (Closed)
Patch Set: Update comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/system/night_light/night_light_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 313 }
313 314
314 // static 315 // static
315 bool Shell::ShouldUseIMEService() { 316 bool Shell::ShouldUseIMEService() {
316 return Shell::GetAshConfig() == Config::MASH || 317 return Shell::GetAshConfig() == Config::MASH ||
317 (Shell::GetAshConfig() == Config::MUS && 318 (Shell::GetAshConfig() == Config::MUS &&
318 base::CommandLine::ForCurrentProcess()->HasSwitch( 319 base::CommandLine::ForCurrentProcess()->HasSwitch(
319 switches::kUseIMEService)); 320 switches::kUseIMEService));
320 } 321 }
321 322
323 // static
324 void Shell::RegisterPrefs(PrefRegistrySimple* registry) {
325 NightLightController::RegisterPrefs(registry);
326 }
327
322 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( 328 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView(
323 views::Widget* widget) { 329 views::Widget* widget) {
324 // Use translucent-style window frames for dialogs. 330 // Use translucent-style window frames for dialogs.
325 return new CustomFrameViewAsh(widget); 331 return new CustomFrameViewAsh(widget);
326 } 332 }
327 333
328 void Shell::SetDisplayWorkAreaInsets(Window* contains, 334 void Shell::SetDisplayWorkAreaInsets(Window* contains,
329 const gfx::Insets& insets) { 335 const gfx::Insets& insets) {
330 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); 336 shell_port_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets);
331 } 337 }
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 cast_config_(base::MakeUnique<CastConfigController>()), 561 cast_config_(base::MakeUnique<CastConfigController>()),
556 focus_cycler_(base::MakeUnique<FocusCycler>()), 562 focus_cycler_(base::MakeUnique<FocusCycler>()),
557 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()), 563 immersive_context_(base::MakeUnique<ImmersiveContextAsh>()),
558 keyboard_brightness_control_delegate_( 564 keyboard_brightness_control_delegate_(
559 base::MakeUnique<KeyboardBrightnessController>()), 565 base::MakeUnique<KeyboardBrightnessController>()),
560 locale_notification_controller_( 566 locale_notification_controller_(
561 base::MakeUnique<LocaleNotificationController>()), 567 base::MakeUnique<LocaleNotificationController>()),
562 media_controller_(base::MakeUnique<MediaController>()), 568 media_controller_(base::MakeUnique<MediaController>()),
563 new_window_controller_(base::MakeUnique<NewWindowController>()), 569 new_window_controller_(base::MakeUnique<NewWindowController>()),
564 session_controller_(base::MakeUnique<SessionController>()), 570 session_controller_(base::MakeUnique<SessionController>()),
571 night_light_controller_(
572 base::MakeUnique<NightLightController>(session_controller_.get())),
565 shelf_controller_(base::MakeUnique<ShelfController>()), 573 shelf_controller_(base::MakeUnique<ShelfController>()),
566 shell_delegate_(std::move(shell_delegate)), 574 shell_delegate_(std::move(shell_delegate)),
567 shutdown_controller_(base::MakeUnique<ShutdownController>()), 575 shutdown_controller_(base::MakeUnique<ShutdownController>()),
568 system_tray_controller_(base::MakeUnique<SystemTrayController>()), 576 system_tray_controller_(base::MakeUnique<SystemTrayController>()),
569 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), 577 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()),
570 tray_action_(base::MakeUnique<TrayAction>()), 578 tray_action_(base::MakeUnique<TrayAction>()),
571 vpn_list_(base::MakeUnique<VpnList>()), 579 vpn_list_(base::MakeUnique<VpnList>()),
572 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), 580 window_cycle_controller_(base::MakeUnique<WindowCycleController>()),
573 window_selector_controller_(base::MakeUnique<WindowSelectorController>()), 581 window_selector_controller_(base::MakeUnique<WindowSelectorController>()),
574 app_list_(base::MakeUnique<app_list::AppList>()), 582 app_list_(base::MakeUnique<app_list::AppList>()),
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 void Shell::OnPrefServiceInitialized( 1263 void Shell::OnPrefServiceInitialized(
1256 std::unique_ptr<::PrefService> pref_service) { 1264 std::unique_ptr<::PrefService> pref_service) {
1257 if (!instance_) 1265 if (!instance_)
1258 return; 1266 return;
1259 // |pref_service_| is null if can't connect to Chrome (as happens when 1267 // |pref_service_| is null if can't connect to Chrome (as happens when
1260 // running mash outside of chrome --mash and chrome isn't built). 1268 // running mash outside of chrome --mash and chrome isn't built).
1261 pref_service_ = std::move(pref_service); 1269 pref_service_ = std::move(pref_service);
1262 } 1270 }
1263 1271
1264 } // namespace ash 1272 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/system/night_light/night_light_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698