Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: ui/display/chromeos/display_configurator.cc

Issue 657583003: Chrome OS: Ash support for >=3 displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased at 306637. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698