From fea761fceec8090fef4c812cd2f0d5ee48b7fe1c Mon Sep 17 00:00:00 2001 From: "mukai@chromium.org" Date: Fri, 1 Mar 2013 04:06:50 +0000 Subject: 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 --- chromeos/display/output_configurator.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'chromeos/display/output_configurator.cc') 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); -- cgit v1.1