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

Unified Diff: chromeos/display/output_configurator.h

Issue 10817028: Add Fade-out/Fade-in animation during output-configuration change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/display_options_handler.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698