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

Unified Diff: chromeos/display/output_configurator.cc

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
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 9806edf3758e74450a04e60806a1c47a2cd6842a..d3f23114e496d6c989bf7c6a4b91bf569b267069 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -16,6 +16,7 @@
#undef Status
#undef RootWindow
+#include "base/bind.h"
#include "base/chromeos/chromeos_version.h"
#include "base/logging.h"
#include "base/message_pump_aurax11.h"
@@ -399,6 +400,11 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
new_state);
XRRFreeScreenResources(screen);
XUngrabServer(display);
+
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&OutputConfigurator::NotifyOnDisplayChanged,
+ base::Unretained(this)));
+
return true;
}
@@ -424,6 +430,14 @@ bool OutputConfigurator::Dispatch(const base::NativeEvent& event) {
return true;
}
+void OutputConfigurator::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void OutputConfigurator::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
bool OutputConfigurator::TryRecacheOutputs(Display* display,
XRRScreenResources* screen) {
bool outputs_did_change = false;
@@ -843,4 +857,8 @@ void OutputConfigurator::CheckIsProjectingAndNotify() {
dbus::ObjectProxy::EmptyResponseCallback());
}
+void OutputConfigurator::NotifyOnDisplayChanged() {
+ FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChanged());
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698