Chromium Code Reviews| 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..24aa244c561bfcbf12999cc7eecebb0a3e4b2dbb 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"; |
| @@ -982,12 +989,13 @@ MultipleDisplayState DisplayConfigurator::ChooseDisplayState( |
| return MULTIPLE_DISPLAY_STATE_HEADLESS; |
| case 1: |
| return MULTIPLE_DISPLAY_STATE_SINGLE; |
| - case 2: { |
| + case 2: |
| + default: { |
|
oshima
2014/12/05 23:29:56
nit: just "default:"
hshi1
2014/12/05 23:35:19
Done.
|
| if (num_on_displays == 1) { |
| // If only one display is currently turned on, return the "single" |
| // state so that its native mode will be used. |
| return MULTIPLE_DISPLAY_STATE_SINGLE; |
| - } else { |
| + } else if (num_on_displays == 2) { |
| if (!state_controller_) |
| return MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED; |
| // With either both displays on or both displays off, use one of the |
| @@ -997,10 +1005,12 @@ MultipleDisplayState DisplayConfigurator::ChooseDisplayState( |
| display_ids.push_back(cached_displays_[i].display->display_id()); |
| return state_controller_->GetStateForDisplayIds(display_ids); |
| + } else if (num_on_displays >= 3) { |
| + return MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED; |
| + } else { |
| + NOTREACHED(); |
| } |
|
oshima
2014/12/05 23:29:56
nit: remove else{} and just NOTREACHED().
hshi1
2014/12/05 23:35:19
Done.
|
| } |
| - default: |
| - NOTREACHED(); |
| } |
| return MULTIPLE_DISPLAY_STATE_INVALID; |
| } |