| 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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 for (const auto& callback : queued_configuration_callbacks_) | 1102 for (const auto& callback : queued_configuration_callbacks_) |
| 1103 callback.Run(success); | 1103 callback.Run(success); |
| 1104 | 1104 |
| 1105 queued_configuration_callbacks_.clear(); | 1105 queued_configuration_callbacks_.clear(); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 void DisplayConfigurator::NotifyDisplayStateObservers( | 1108 void DisplayConfigurator::NotifyDisplayStateObservers( |
| 1109 bool success, | 1109 bool success, |
| 1110 MultipleDisplayState attempted_state) { | 1110 MultipleDisplayState attempted_state) { |
| 1111 if (success) { | 1111 if (success) { |
| 1112 FOR_EACH_OBSERVER( | 1112 for (Observer& observer : observers_) |
| 1113 Observer, observers_, OnDisplayModeChanged(cached_displays_)); | 1113 observer.OnDisplayModeChanged(cached_displays_); |
| 1114 } else { | 1114 } else { |
| 1115 FOR_EACH_OBSERVER( | 1115 for (Observer& observer : observers_) |
| 1116 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, | 1116 observer.OnDisplayModeChangeFailed(cached_displays_, attempted_state); |
| 1117 attempted_state)); | |
| 1118 } | 1117 } |
| 1119 } | 1118 } |
| 1120 | 1119 |
| 1121 void DisplayConfigurator::NotifyPowerStateObservers() { | 1120 void DisplayConfigurator::NotifyPowerStateObservers() { |
| 1122 FOR_EACH_OBSERVER( | 1121 for (Observer& observer : observers_) |
| 1123 Observer, observers_, OnPowerStateChanged(current_power_state_)); | 1122 observer.OnPowerStateChanged(current_power_state_); |
| 1124 } | 1123 } |
| 1125 | 1124 |
| 1126 int64_t DisplayConfigurator::AddVirtualDisplay(const gfx::Size& display_size) { | 1125 int64_t DisplayConfigurator::AddVirtualDisplay(const gfx::Size& display_size) { |
| 1127 if (last_virtual_display_id_ == 0xff) { | 1126 if (last_virtual_display_id_ == 0xff) { |
| 1128 LOG(WARNING) << "Exceeded virtual display id limit"; | 1127 LOG(WARNING) << "Exceeded virtual display id limit"; |
| 1129 return display::Display::kInvalidDisplayID; | 1128 return display::Display::kInvalidDisplayID; |
| 1130 } | 1129 } |
| 1131 | 1130 |
| 1132 DisplaySnapshotVirtual* virtual_snapshot = new DisplaySnapshotVirtual( | 1131 DisplaySnapshotVirtual* virtual_snapshot = new DisplaySnapshotVirtual( |
| 1133 display::GenerateDisplayID(kReservedManufacturerID, 0x0, | 1132 display::GenerateDisplayID(kReservedManufacturerID, 0x0, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1160 last_virtual_display_id_ = max_display_id & 0xff; | 1159 last_virtual_display_id_ = max_display_id & 0xff; |
| 1161 | 1160 |
| 1162 return true; | 1161 return true; |
| 1163 } | 1162 } |
| 1164 | 1163 |
| 1165 bool DisplayConfigurator::IsDisplayOn() const { | 1164 bool DisplayConfigurator::IsDisplayOn() const { |
| 1166 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; | 1165 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; |
| 1167 } | 1166 } |
| 1168 | 1167 |
| 1169 } // namespace ui | 1168 } // namespace ui |
| OLD | NEW |