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

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

Issue 2152303002: Allow idle/suspend with 3+ monitors attached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-power-state
Patch Set: Created 4 years, 5 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/display_configurator_unittest.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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 size = mode_info->size(); 289 size = mode_info->size();
290 290
291 for (size_t i = 0; i < states.size(); ++i) { 291 for (size_t i = 0; i < states.size(); ++i) {
292 const DisplayState* state = &states[i]; 292 const DisplayState* state = &states[i];
293 (*requests)[i].mode = display_power[i] ? state->mirror_mode : NULL; 293 (*requests)[i].mode = display_power[i] ? state->mirror_mode : NULL;
294 } 294 }
295 break; 295 break;
296 } 296 }
297 case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED: 297 case MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED:
298 case MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED: { 298 case MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED: {
299 if ((new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED && 299 if (new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED &&
300 states.size() != 2 && num_on_displays != 2) || 300 states.size() != 2 && num_on_displays != 2) {
301 (new_display_state == MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED &&
302 num_on_displays <= 2)) {
303 LOG(WARNING) << "Ignoring request to enter extended mode with " 301 LOG(WARNING) << "Ignoring request to enter extended mode with "
304 << states.size() << " connected display(s) and " 302 << states.size() << " connected display(s) and "
305 << num_on_displays << " turned on"; 303 << num_on_displays << " turned on";
306 return false; 304 return false;
307 } 305 }
oshima 2016/07/15 23:58:15 can you add comment that in docked mode, we may ge
dnicoara 2016/07/18 14:19:02 Actually the state would be MULTIPLE_DISPLAY_STATE
308 306
309 for (size_t i = 0; i < states.size(); ++i) { 307 for (size_t i = 0; i < states.size(); ++i) {
310 const DisplayState* state = &states[i]; 308 const DisplayState* state = &states[i];
311 (*requests)[i].origin.set_y(size.height() ? size.height() + kVerticalGap 309 (*requests)[i].origin.set_y(size.height() ? size.height() + kVerticalGap
312 : 0); 310 : 0);
313 (*requests)[i].mode = display_power[i] ? state->selected_mode : NULL; 311 (*requests)[i].mode = display_power[i] ? state->selected_mode : NULL;
314 312
315 // Retain the full screen size even if all displays are off so the 313 // Retain the full screen size even if all displays are off so the
316 // same desktop configuration can be restored when the displays are 314 // same desktop configuration can be restored when the displays are
317 // turned back on. 315 // turned back on.
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 last_virtual_display_id_ = max_display_id & 0xff; 1157 last_virtual_display_id_ = max_display_id & 0xff;
1160 1158
1161 return true; 1159 return true;
1162 } 1160 }
1163 1161
1164 bool DisplayConfigurator::IsDisplayOn() const { 1162 bool DisplayConfigurator::IsDisplayOn() const {
1165 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; 1163 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF;
1166 } 1164 }
1167 1165
1168 } // namespace ui 1166 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698