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

Side by Side Diff: ui/display/chromeos/display_configurator.cc

Issue 1634323002: Fix dock mode with 2+ external displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix broken tests Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/display/chromeos/update_display_configuration_task.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/display/chromeos/display_configurator.h" 5 #include "ui/display/chromeos/display_configurator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 for (size_t i = 0; i < states.size(); ++i) { 297 for (size_t i = 0; i < states.size(); ++i) {
298 const DisplayState* state = &states[i]; 298 const DisplayState* state = &states[i];
299 (*requests)[i].mode = display_power[i] ? state->mirror_mode : NULL; 299 (*requests)[i].mode = display_power[i] ? state->mirror_mode : NULL;
300 } 300 }
301 break; 301 break;
302 } 302 }
303 case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED: 303 case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED:
304 case MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED: { 304 case MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED: {
305 if ((new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED && 305 if ((new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED &&
306 states.size() != 2) || 306 states.size() != 2 && num_on_displays != 2) ||
307 (new_display_state == MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED && 307 (new_display_state == MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED &&
308 states.size() <= 2) || 308 num_on_displays <= 2)) {
309 (num_on_displays != 0 &&
310 num_on_displays != static_cast<int>(displays.size()))) {
311 LOG(WARNING) << "Ignoring request to enter extended mode with " 309 LOG(WARNING) << "Ignoring request to enter extended mode with "
312 << states.size() << " connected display(s) and " 310 << states.size() << " connected display(s) and "
313 << num_on_displays << " turned on"; 311 << num_on_displays << " turned on";
314 return false; 312 return false;
315 } 313 }
316 314
317 for (size_t i = 0; i < states.size(); ++i) { 315 for (size_t i = 0; i < states.size(); ++i) {
318 const DisplayState* state = &states[i]; 316 const DisplayState* state = &states[i];
319 (*requests)[i].origin.set_y(size.height() ? size.height() + kVerticalGap 317 (*requests)[i].origin.set_y(size.height() ? size.height() + kVerticalGap
320 : 0); 318 : 0);
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 1134
1137 int64_t max_display_id = 0; 1135 int64_t max_display_id = 0;
1138 for (const auto& display : virtual_display_snapshots_) 1136 for (const auto& display : virtual_display_snapshots_)
1139 max_display_id = std::max(max_display_id, display->display_id()); 1137 max_display_id = std::max(max_display_id, display->display_id());
1140 last_virtual_display_id_ = max_display_id & 0xff; 1138 last_virtual_display_id_ = max_display_id & 0xff;
1141 1139
1142 return true; 1140 return true;
1143 } 1141 }
1144 1142
1145 } // namespace ui 1143 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/display/chromeos/update_display_configuration_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698