Index: chromeos/display/output_configurator.cc |
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc |
index 60013092234cbe9ba6612111b451f5159126c88e..4f8c78904a493dfc91ec73514be9670c95fc4a30 100644 |
--- a/chromeos/display/output_configurator.cc |
+++ b/chromeos/display/output_configurator.cc |
@@ -16,6 +16,7 @@ |
#undef Status |
#undef RootWindow |
+#include "ash/display/display_controller.h" |
#include "base/chromeos/chromeos_version.h" |
#include "base/logging.h" |
#include "base/message_pump_aurax11.h" |
@@ -662,6 +663,19 @@ State OutputConfigurator::InferCurrentState(Display* display, |
bool OutputConfigurator::CycleDisplayMode() { |
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 (ash::internal::DisplayController::IsExtendedDesktopEnabled()) { |
oshima
2012/07/25 23:44:20
/chromeos can't depend on /ash.Can you let ash swi
rkc
2012/07/25 23:59:37
Done.
|
+ 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; |
+ } |
+ } |
+ |
if (is_running_on_chrome_os_) { |
// Rules: |
// - if there are 0 or 1 displays, do nothing and return false. |
@@ -674,7 +688,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_ ? |