summaryrefslogtreecommitdiffstats
path: root/chromeos/display/output_configurator.cc
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 04:06:50 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 04:06:50 +0000
commitfea761fceec8090fef4c812cd2f0d5ee48b7fe1c (patch)
tree30366631ee3bb394b8afd9cb773693f9ee8589af /chromeos/display/output_configurator.cc
parentbca1a566a98ff8a4ebf1625d7fe578dbfb569cd4 (diff)
downloadchromium_src-fea761fceec8090fef4c812cd2f0d5ee48b7fe1c.zip
chromium_src-fea761fceec8090fef4c812cd2f0d5ee48b7fe1c.tar.gz
chromium_src-fea761fceec8090fef4c812cd2f0d5ee48b7fe1c.tar.bz2
Provides more types of errors for display status.
Note that the text message itself is a placeholder. It has to be replaced by real sentences. BUG=176011 TEST=ash_unittests passes Review URL: https://chromiumcodereview.appspot.com/12212171 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/display/output_configurator.cc')
-rw-r--r--chromeos/display/output_configurator.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 00c0f72..4357b1a 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -654,10 +654,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;
}
@@ -759,10 +761,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;
}
@@ -833,6 +837,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);