Chromium Code Reviews| Index: ash/display/display_controller.h |
| diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h |
| index d6e122ec86406cbe36ecf1ba1e78f1165abc0799..06151a216829677bde1ed84cc8b237d505ced5e6 100644 |
| --- a/ash/display/display_controller.h |
| +++ b/ash/display/display_controller.h |
| @@ -11,6 +11,8 @@ |
| #include "ash/ash_export.h" |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| +#include "base/gtest_prod_util.h" |
| +#include "base/observer_list.h" |
| #include "ui/aura/display_observer.h" |
| #include "ui/aura/display_manager.h" |
| @@ -61,6 +63,13 @@ struct ASH_EXPORT DisplayLayout { |
| // display, keeping them in sync with display configuration changes. |
| class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
| public: |
| + class Observer { |
| + public: |
| + // Invoked when the display configuration change is requested, |
| + // but before the change is applied to aura/ash. |
| + virtual void OnDisplayConfigurationChanging() = 0; |
| + }; |
|
sky
2012/09/05 22:45:37
protected virtual destructor.
|
| + |
| DisplayController(); |
| virtual ~DisplayController(); |
| @@ -70,6 +79,10 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
| // Initialize secondary displays. |
| void InitSecondaryDisplays(); |
| + // Add/Remove observers. |
| + void AddObserver(Observer* observer); |
| + void RemoveObserver(Observer* observer); |
| + |
| // Returns the root window for primary display. |
| aura::RootWindow* GetPrimaryRootWindow(); |
| @@ -111,6 +124,8 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
| void UpdateDisplayBoundsForLayout(); |
| + void NotifyDisplayConfigurationChanging(); |
| + |
| // The mapping from display ID to its root window. |
| std::map<int64, aura::RootWindow*> root_windows_; |
| @@ -120,6 +135,8 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
| // Per-device display layout. |
| std::map<std::string, DisplayLayout> secondary_layouts_; |
| + ObserverList<Observer> observers_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(DisplayController); |
| }; |