OLD | NEW |
---|---|
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 Loading... | |
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 // In docked mode (with internal display + 2 external displays) the state |
300 states.size() != 2 && num_on_displays != 2) || | 300 // will be DUAL_EXTENDED with internal display turned off and the 2 |
301 (new_display_state == MULTIPLE_DISPLAY_STATE_MULTI_EXTENDED && | 301 // external displays turned on. |
oshima
2016/07/20 14:37:53
ack. thank you for clarificatin.
| |
302 num_on_displays <= 2)) { | 302 if (new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED && |
303 states.size() != 2 && num_on_displays != 2) { | |
303 LOG(WARNING) << "Ignoring request to enter extended mode with " | 304 LOG(WARNING) << "Ignoring request to enter extended mode with " |
304 << states.size() << " connected display(s) and " | 305 << states.size() << " connected display(s) and " |
305 << num_on_displays << " turned on"; | 306 << num_on_displays << " turned on"; |
306 return false; | 307 return false; |
307 } | 308 } |
308 | 309 |
309 for (size_t i = 0; i < states.size(); ++i) { | 310 for (size_t i = 0; i < states.size(); ++i) { |
310 const DisplayState* state = &states[i]; | 311 const DisplayState* state = &states[i]; |
311 (*requests)[i].origin.set_y(size.height() ? size.height() + kVerticalGap | 312 (*requests)[i].origin.set_y(size.height() ? size.height() + kVerticalGap |
312 : 0); | 313 : 0); |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1159 last_virtual_display_id_ = max_display_id & 0xff; | 1160 last_virtual_display_id_ = max_display_id & 0xff; |
1160 | 1161 |
1161 return true; | 1162 return true; |
1162 } | 1163 } |
1163 | 1164 |
1164 bool DisplayConfigurator::IsDisplayOn() const { | 1165 bool DisplayConfigurator::IsDisplayOn() const { |
1165 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; | 1166 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; |
1166 } | 1167 } |
1167 | 1168 |
1168 } // namespace ui | 1169 } // namespace ui |
OLD | NEW |