Index: chromeos/display/output_configurator.h |
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h |
index b1518dbf641f494a86248af89a2314491cdb908c..bbf0063590b4a3e32e6aef0edaf99d4153b9d112 100644 |
--- a/chromeos/display/output_configurator.h |
+++ b/chromeos/display/output_configurator.h |
@@ -7,6 +7,7 @@ |
#include "base/basictypes.h" |
#include "base/event_types.h" |
+#include "base/observer_list.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
#include "chromeos/chromeos_export.h" |
@@ -40,6 +41,13 @@ enum OutputState { |
// it. |
class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
public: |
+ class Observer { |
+ public: |
+ // Called when the change of the display mode finished. It will usually |
+ // start the fading in the displays. |
+ virtual void OnDisplayModeChanged() = 0; |
+ }; |
+ |
explicit OutputConfigurator(bool is_extended_display_enabled); |
virtual ~OutputConfigurator(); |
@@ -67,6 +75,9 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
// Spurious events will have no effect. |
virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
+ void AddObserver(Observer* observer); |
+ void RemoveObserver(Observer* observer); |
+ |
private: |
// The information we need to cache from an output to implement operations |
// such as power state but also to eliminate duplicate operations within a |
@@ -124,6 +135,9 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
// with the result. |
void CheckIsProjectingAndNotify(); |
+ // Fires OnDisplayModeChanged() event to the observers. |
+ void NotifyOnDisplayChanged(); |
+ |
// This is detected by the constructor to determine whether or not we should |
// be enabled. If we aren't running on ChromeOS, we can't assume that the |
// Xrandr X11 extension is supported. |
@@ -161,6 +175,8 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
// This is used for rotating display modes. |
OutputState output_state_; |
+ ObserverList<Observer> observers_; |
+ |
DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); |
}; |