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

Side by Side Diff: ui/display/chromeos/update_display_configuration_task.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
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/update_display_configuration_task.h" 5 #include "ui/display/chromeos/update_display_configuration_task.h"
6 6
7 #include "ui/display/chromeos/configure_displays_task.h" 7 #include "ui/display/chromeos/configure_displays_task.h"
8 #include "ui/display/chromeos/display_layout_manager.h" 8 #include "ui/display/chromeos/display_layout_manager.h"
9 #include "ui/display/chromeos/display_util.h" 9 #include "ui/display/chromeos/display_util.h"
10 #include "ui/display/types/display_snapshot.h" 10 #include "ui/display/types/display_snapshot.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (num_displays == 2 || num_on_displays == 2) { 197 if (num_displays == 2 || num_on_displays == 2) {
198 // Try to use the saved configuration; otherwise, default to extended. 198 // Try to use the saved configuration; otherwise, default to extended.
199 DisplayConfigurator::StateController* state_controller = 199 DisplayConfigurator::StateController* state_controller =
200 layout_manager_->GetStateController(); 200 layout_manager_->GetStateController();
201 201
202 if (!state_controller) 202 if (!state_controller)
203 return MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED; 203 return MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED;
204 return state_controller->GetStateForDisplayIds(cached_displays_); 204 return state_controller->GetStateForDisplayIds(cached_displays_);
205 } 205 }
206 206
207 if (num_on_displays >= 3) { 207 if (num_displays >= 3) {
208 // 3+ displays are always extended 208 // 3+ displays are always extended
209 return MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED; 209 return MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED;
210 } 210 }
211 211
212 return MULTIPLE_DISPLAY_STATE_INVALID; 212 return MULTIPLE_DISPLAY_STATE_INVALID;
213 } 213 }
214 214
215 } // namespace ui 215 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698