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

Unified Diff: chromeos/display/output_configurator.cc

Issue 12212171: Provides more types of errors for output status. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 8bb89bfc6bb2f27b94483e94f262138f4880c872..86d0262d4d8afd5efc4c2c215cbb620e641cee39 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -649,10 +649,12 @@ bool OutputConfigurator::CycleDisplayMode() {
XRRFreeScreenResources(screen);
XUngrabServer(display);
- if (did_change)
+ if (did_change) {
NotifyOnDisplayChanged();
- else
- FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChangeFailed());
+ } else {
+ FOR_EACH_OBSERVER(
+ Observer, observers_, OnDisplayModeChangeFailed(next_state));
+ }
return did_change;
}
@@ -754,10 +756,12 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) {
XRRFreeScreenResources(screen);
XUngrabServer(display);
- if (output_state_ == new_state)
+ if (output_state_ == new_state) {
NotifyOnDisplayChanged();
- else
- FOR_EACH_OBSERVER(Observer, observers_, OnDisplayModeChangeFailed());
+ } else {
+ FOR_EACH_OBSERVER(
+ Observer, observers_, OnDisplayModeChangeFailed(new_state));
+ }
return true;
}
@@ -828,6 +832,9 @@ void OutputConfigurator::ConfigureOutputs() {
if (success) {
output_state_ = new_state;
NotifyOnDisplayChanged();
+ } else {
+ FOR_EACH_OBSERVER(
+ Observer, observers_, OnDisplayModeChangeFailed(new_state));
}
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
SetIsProjecting(is_projecting);
« ash/display/display_error_dialog_unittest.cc ('K') | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698