Chromium Code Reviews| Index: ash/display/display_change_observer_chromeos.h |
| diff --git a/ash/display/display_change_observer_chromeos.h b/ash/display/display_change_observer_chromeos.h |
| index 2e447788239c508ac5ca7492133a2a5c85172a36..e504f29e8af994d6de61761d708671179505c2da 100644 |
| --- a/ash/display/display_change_observer_chromeos.h |
| +++ b/ash/display/display_change_observer_chromeos.h |
| @@ -7,25 +7,28 @@ |
| #include <stdint.h> |
| +#include <memory> |
| #include <vector> |
| #include "ash/ash_export.h" |
| -#include "ash/common/shell_observer.h" |
| #include "base/macros.h" |
| #include "ui/display/manager/chromeos/display_configurator.h" |
| #include "ui/display/manager/managed_display_info.h" |
| #include "ui/events/devices/input_device_event_observer.h" |
| +namespace display { |
| +class DisplayManager; |
| +} |
| + |
| namespace ash { |
| class DisplaySnapshot; |
| -// An object that observes changes in display configuration and |
| -// update DisplayManagers. |
| +// An object that observes changes in display configuration and updates |
| +// DisplayManager. |
| class DisplayChangeObserver : public ui::DisplayConfigurator::StateController, |
| public ui::DisplayConfigurator::Observer, |
| - public ui::InputDeviceEventObserver, |
| - public ShellObserver { |
| + public ui::InputDeviceEventObserver { |
| public: |
| // Returns the mode list for internal display. |
| ASH_EXPORT static display::ManagedDisplayInfo::ManagedDisplayModeList |
| @@ -40,6 +43,14 @@ class DisplayChangeObserver : public ui::DisplayConfigurator::StateController, |
| DisplayChangeObserver(); |
| ~DisplayChangeObserver() override; |
| + void set_display_manager(display::DisplayManager* display_manager) { |
| + display_manager_ = display_manager; |
| + } |
| + |
| + void set_display_configurator(ui::DisplayConfigurator* display_configurator) { |
| + display_configurator_ = display_configurator; |
| + } |
| + |
| // ui::DisplayConfigurator::StateController overrides: |
| ui::MultipleDisplayState GetStateForDisplayIds( |
| const ui::DisplayConfigurator::DisplayStateList& outputs) const override; |
| @@ -56,13 +67,13 @@ class DisplayChangeObserver : public ui::DisplayConfigurator::StateController, |
| // Overriden from ui::InputDeviceEventObserver: |
| void OnTouchscreenDeviceConfigurationChanged() override; |
| - // Overriden from ShellObserver: |
| - void OnAppTerminating() override; |
| - |
| // Exposed for testing. |
| ASH_EXPORT static float FindDeviceScaleFactor(float dpi); |
| private: |
|
oshima
2016/12/02 19:07:45
can you document ownership/lifetime of these objec
kylechar
2016/12/02 20:32:36
Done.
|
| + display::DisplayManager* display_manager_ = nullptr; |
| + ui::DisplayConfigurator* display_configurator_ = nullptr; |
| + |
| DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver); |
| }; |