Index: ui/display/chromeos/display_configurator.cc |
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc |
index f20b737311b8b1c3e34cc3451549cd77f9a6b975..8f770b89fdb0e5660d86693aafddac688afd83dc 100644 |
--- a/ui/display/chromeos/display_configurator.cc |
+++ b/ui/display/chromeos/display_configurator.cc |
@@ -61,6 +61,8 @@ std::string DisplayStateToString(MultipleDisplayState state) { |
return "DUAL_MIRROR"; |
case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED: |
return "DUAL_EXTENDED"; |
+ case MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED: |
+ return "MULTI_EXTENDED"; |
} |
NOTREACHED() << "Unknown state " << state; |
return "INVALID"; |
@@ -878,9 +880,14 @@ bool DisplayConfigurator::EnterState(MultipleDisplayState display_state, |
} |
break; |
} |
- case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED: { |
- if (cached_displays_.size() != 2 || |
- (num_on_displays != 0 && num_on_displays != 2)) { |
+ case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED: |
+ case MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED: { |
+ if ((display_state == MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED && |
+ cached_displays_.size() != 2) || |
+ (display_state == MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED && |
+ cached_displays_.size() <= 2) || |
+ (num_on_displays != 0 && |
+ num_on_displays != static_cast<int>(cached_displays_.size()))) { |
LOG(WARNING) << "Ignoring request to enter extended mode with " |
<< cached_displays_.size() << " connected display(s) and " |
<< num_on_displays << " turned on"; |
@@ -999,8 +1006,12 @@ MultipleDisplayState DisplayConfigurator::ChooseDisplayState( |
return state_controller_->GetStateForDisplayIds(display_ids); |
} |
} |
- default: |
- NOTREACHED(); |
+ default: { |
oshima
2014/12/05 22:18:15
add comment that this is for >3 case.
hshi1
2014/12/05 23:25:12
Acknowledged.
|
+ if (num_on_displays == 1) |
+ return MULTIPLE_DISPLAY_STATE_SINGLE; |
oshima
2014/12/05 22:18:15
don't you have to handle == 2 case?
hshi1
2014/12/05 23:25:13
I think it is actually better to just handle the c
|
+ else |
+ return MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED; |
+ } |
} |
return MULTIPLE_DISPLAY_STATE_INVALID; |
} |