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

Side by Side Diff: ash/shell.cc

Issue 2524863003: Move DisplayChangeObserver + tests from ash to ui. (Closed)
Patch Set: Replace with static method. Created 4 years 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
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 #if defined(OS_CHROMEOS) 112 #if defined(OS_CHROMEOS)
113 #if defined(USE_X11) 113 #if defined(USE_X11)
114 #include "ui/gfx/x/x11_types.h" // nogncheck 114 #include "ui/gfx/x/x11_types.h" // nogncheck
115 #endif // defined(USE_X11) 115 #endif // defined(USE_X11)
116 #include "ash/accelerators/magnifier_key_scroller.h" 116 #include "ash/accelerators/magnifier_key_scroller.h"
117 #include "ash/accelerators/spoken_feedback_toggler.h" 117 #include "ash/accelerators/spoken_feedback_toggler.h"
118 #include "ash/common/ash_constants.h" 118 #include "ash/common/ash_constants.h"
119 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller .h" 119 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller .h"
120 #include "ash/common/system/chromeos/power/power_status.h" 120 #include "ash/common/system/chromeos/power/power_status.h"
121 #include "ash/display/ash_display_string_provider.h" 121 #include "ash/display/ash_display_string_provider.h"
122 #include "ash/display/display_change_observer_chromeos.h"
123 #include "ash/display/display_color_manager_chromeos.h" 122 #include "ash/display/display_color_manager_chromeos.h"
124 #include "ash/display/display_error_observer_chromeos.h" 123 #include "ash/display/display_error_observer_chromeos.h"
125 #include "ash/display/projecting_observer_chromeos.h" 124 #include "ash/display/projecting_observer_chromeos.h"
126 #include "ash/display/resolution_notification_controller.h" 125 #include "ash/display/resolution_notification_controller.h"
127 #include "ash/display/screen_orientation_controller_chromeos.h" 126 #include "ash/display/screen_orientation_controller_chromeos.h"
128 #include "ash/display/shutdown_observer_chromeos.h" 127 #include "ash/display/shutdown_observer_chromeos.h"
129 #include "ash/sticky_keys/sticky_keys_controller.h" 128 #include "ash/sticky_keys/sticky_keys_controller.h"
130 #include "ash/system/chromeos/power/power_event_observer.h" 129 #include "ash/system/chromeos/power/power_event_observer.h"
131 #include "ash/system/chromeos/power/video_activity_notifier.h" 130 #include "ash/system/chromeos/power/video_activity_notifier.h"
132 #include "ash/touch/touch_transformer_controller.h" 131 #include "ash/touch/touch_transformer_controller.h"
133 #include "ash/virtual_keyboard_controller.h" 132 #include "ash/virtual_keyboard_controller.h"
134 #include "base/bind_helpers.h" 133 #include "base/bind_helpers.h"
135 #include "base/sys_info.h" 134 #include "base/sys_info.h"
136 #include "chromeos/audio/audio_a11y_controller.h" 135 #include "chromeos/audio/audio_a11y_controller.h"
137 #include "chromeos/chromeos_switches.h" 136 #include "chromeos/chromeos_switches.h"
138 #include "chromeos/dbus/dbus_thread_manager.h" 137 #include "chromeos/dbus/dbus_thread_manager.h"
139 #include "ui/chromeos/user_activity_power_manager_notifier.h" 138 #include "ui/chromeos/user_activity_power_manager_notifier.h"
139 #include "ui/display/chromeos/display_change_observer.h"
140 #include "ui/display/chromeos/display_configurator.h" 140 #include "ui/display/chromeos/display_configurator.h"
141 141
142 #if defined(USE_X11) 142 #if defined(USE_X11)
143 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" 143 #include "ui/display/chromeos/x11/native_display_delegate_x11.h"
144 #endif 144 #endif
145 145
146 #if defined(USE_OZONE) 146 #if defined(USE_OZONE)
147 #include "ui/display/types/native_display_delegate.h" 147 #include "ui/display/types/native_display_delegate.h"
148 #include "ui/ozone/public/ozone_platform.h" 148 #include "ui/ozone/public/ozone_platform.h"
149 #endif 149 #endif
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 616
617 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. 617 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell.
618 chromeos::DBusThreadManager* dbus_thread_manager = 618 chromeos::DBusThreadManager* dbus_thread_manager =
619 chromeos::DBusThreadManager::Get(); 619 chromeos::DBusThreadManager::Get();
620 projecting_observer_.reset( 620 projecting_observer_.reset(
621 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); 621 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient()));
622 display_configurator_->AddObserver(projecting_observer_.get()); 622 display_configurator_->AddObserver(projecting_observer_.get());
623 wm_shell_->AddShellObserver(projecting_observer_.get()); 623 wm_shell_->AddShellObserver(projecting_observer_.get());
624 624
625 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { 625 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) {
626 display_change_observer_ = base::MakeUnique<DisplayChangeObserver>( 626 display_change_observer_ = base::MakeUnique<display::DisplayChangeObserver>(
627 base::MakeUnique<AshDisplayStringProvider>()); 627 base::MakeUnique<AshDisplayStringProvider>());
628 display_change_observer_->set_display_configurator( 628 display_change_observer_->set_display_configurator(
629 display_configurator_.get()); 629 display_configurator_.get());
630 display_change_observer_->set_display_manager(display_manager_.get()); 630 display_change_observer_->set_display_manager(display_manager_.get());
631 display_change_observer_->set_display_changing_callback(
632 base::Bind(ui::UserActivityDetector::OnDisplayPowerChangingStatic));
631 633
632 shutdown_observer_ = 634 shutdown_observer_ =
633 base::MakeUnique<ShutdownObserver>(display_configurator_.get()); 635 base::MakeUnique<ShutdownObserver>(display_configurator_.get());
634 636
635 // Register |display_change_observer_| first so that the rest of 637 // Register |display_change_observer_| first so that the rest of
636 // observer gets invoked after the root windows are configured. 638 // observer gets invoked after the root windows are configured.
637 display_configurator_->AddObserver(display_change_observer_.get()); 639 display_configurator_->AddObserver(display_change_observer_.get());
638 display_error_observer_.reset(new DisplayErrorObserver()); 640 display_error_observer_.reset(new DisplayErrorObserver());
639 display_configurator_->AddObserver(display_error_observer_.get()); 641 display_configurator_->AddObserver(display_error_observer_.get());
640 display_configurator_->set_state_controller(display_change_observer_.get()); 642 display_configurator_->set_state_controller(display_change_observer_.get());
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { 917 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const {
916 return std::unique_ptr<ui::EventTargetIterator>(); 918 return std::unique_ptr<ui::EventTargetIterator>();
917 } 919 }
918 920
919 ui::EventTargeter* Shell::GetEventTargeter() { 921 ui::EventTargeter* Shell::GetEventTargeter() {
920 NOTREACHED(); 922 NOTREACHED();
921 return nullptr; 923 return nullptr;
922 } 924 }
923 925
924 } // namespace ash 926 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698