| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 if (cached_displays_.empty()) | 493 if (cached_displays_.empty()) |
| 494 return; | 494 return; |
| 495 | 495 |
| 496 if (!display_externally_controlled_) | 496 if (!display_externally_controlled_) |
| 497 return; | 497 return; |
| 498 | 498 |
| 499 if (!native_display_delegate_->TakeDisplayControl()) | 499 if (!native_display_delegate_->TakeDisplayControl()) |
| 500 return; | 500 return; |
| 501 | 501 |
| 502 display_externally_controlled_ = false; | 502 display_externally_controlled_ = false; |
| 503 | 503 force_configure_ = true; |
| 504 for (DisplayStateList::const_iterator it = cached_displays_.begin(); | 504 RunPendingConfiguration(); |
| 505 it != cached_displays_.end(); ++it) { | |
| 506 native_display_delegate_->Configure(*(it->display), it->selected_mode, | |
| 507 it->display->origin()); | |
| 508 } | |
| 509 } | 505 } |
| 510 | 506 |
| 511 void DisplayConfigurator::RelinquishControl() { | 507 void DisplayConfigurator::RelinquishControl() { |
| 512 if (display_externally_controlled_) | 508 if (display_externally_controlled_) |
| 513 return; | 509 return; |
| 514 | 510 |
| 515 display_externally_controlled_ = true; | 511 display_externally_controlled_ = true; |
| 516 native_display_delegate_->RelinquishDisplayControl(); | 512 native_display_delegate_->RelinquishDisplayControl(); |
| 517 } | 513 } |
| 518 | 514 |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 if (success) { | 951 if (success) { |
| 956 FOR_EACH_OBSERVER( | 952 FOR_EACH_OBSERVER( |
| 957 Observer, observers_, OnDisplayModeChanged(cached_displays_)); | 953 Observer, observers_, OnDisplayModeChanged(cached_displays_)); |
| 958 } else { | 954 } else { |
| 959 FOR_EACH_OBSERVER( | 955 FOR_EACH_OBSERVER( |
| 960 Observer, observers_, OnDisplayModeChangeFailed(attempted_state)); | 956 Observer, observers_, OnDisplayModeChangeFailed(attempted_state)); |
| 961 } | 957 } |
| 962 } | 958 } |
| 963 | 959 |
| 964 } // namespace ui | 960 } // namespace ui |
| OLD | NEW |