Index: chromeos/display/output_configurator.cc |
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc |
index 60013092234cbe9ba6612111b451f5159126c88e..a22937364a11cc47554c1ae5fd1319b77af45874 100644 |
--- a/chromeos/display/output_configurator.cc |
+++ b/chromeos/display/output_configurator.cc |
@@ -659,9 +659,22 @@ State OutputConfigurator::InferCurrentState(Display* display, |
return state; |
} |
-bool OutputConfigurator::CycleDisplayMode() { |
+bool OutputConfigurator::CycleDisplayMode(bool extended_desktop_enabled) { |
VLOG(1) << "CycleDisplayMode"; |
bool did_change = false; |
+ |
+ // The next state to go into if the current state is dual primary. |
+ State next_state_from_dual_primary = STATE_DUAL_SECONDARY_ONLY; |
+ if (extended_desktop_enabled) { |
+ if (mirror_supported_) { |
+ next_state_from_dual_primary = STATE_DUAL_MIRROR; |
+ } else { |
+ // In case mirror is not supported, stay in the |
+ // extended desktop primary display. |
+ next_state_from_dual_primary = STATE_INVALID; |
+ } |
+ } |
Josh Horwich
2012/07/26 00:18:26
Would this be easier to follow if you just put it
rkc
2012/07/26 00:32:52
The ?:'s seemed kinda ugly so I moved it in the sw
|
+ |
if (is_running_on_chrome_os_) { |
// Rules: |
// - if there are 0 or 1 displays, do nothing and return false. |
@@ -674,7 +687,7 @@ bool OutputConfigurator::CycleDisplayMode() { |
new_state = STATE_DUAL_PRIMARY_ONLY; |
break; |
case STATE_DUAL_PRIMARY_ONLY: |
- new_state = STATE_DUAL_SECONDARY_ONLY; |
+ new_state = next_state_from_dual_primary; |
break; |
case STATE_DUAL_SECONDARY_ONLY: |
new_state = mirror_supported_ ? |