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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, | 1109 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, |
1110 attempted_state)); | 1110 attempted_state)); |
1111 } | 1111 } |
1112 } | 1112 } |
1113 | 1113 |
1114 void DisplayConfigurator::NotifyPowerStateObservers() { | 1114 void DisplayConfigurator::NotifyPowerStateObservers() { |
1115 FOR_EACH_OBSERVER( | 1115 FOR_EACH_OBSERVER( |
1116 Observer, observers_, OnPowerStateChanged(current_power_state_)); | 1116 Observer, observers_, OnPowerStateChanged(current_power_state_)); |
1117 } | 1117 } |
1118 | 1118 |
1119 int64_t DisplayConfigurator::AddVirtualDisplay(gfx::Size display_size) { | 1119 int64_t DisplayConfigurator::AddVirtualDisplay(const gfx::Size& display_size) { |
1120 if (last_virtual_display_id_ == 0xff) { | 1120 if (last_virtual_display_id_ == 0xff) { |
1121 LOG(WARNING) << "Exceeded virtual display id limit"; | 1121 LOG(WARNING) << "Exceeded virtual display id limit"; |
1122 return display::Display::kInvalidDisplayID; | 1122 return display::Display::kInvalidDisplayID; |
1123 } | 1123 } |
1124 | 1124 |
1125 DisplaySnapshotVirtual* virtual_snapshot = | 1125 DisplaySnapshotVirtual* virtual_snapshot = |
1126 new DisplaySnapshotVirtual(GenerateDisplayID(kReservedManufacturerID, 0x0, | 1126 new DisplaySnapshotVirtual(GenerateDisplayID(kReservedManufacturerID, 0x0, |
1127 ++last_virtual_display_id_), | 1127 ++last_virtual_display_id_), |
1128 display_size); | 1128 display_size); |
1129 virtual_display_snapshots_.push_back(virtual_snapshot); | 1129 virtual_display_snapshots_.push_back(virtual_snapshot); |
(...skipping 23 matching lines...) Expand all Loading... |
1153 last_virtual_display_id_ = max_display_id & 0xff; | 1153 last_virtual_display_id_ = max_display_id & 0xff; |
1154 | 1154 |
1155 return true; | 1155 return true; |
1156 } | 1156 } |
1157 | 1157 |
1158 bool DisplayConfigurator::IsDisplayOn() const { | 1158 bool DisplayConfigurator::IsDisplayOn() const { |
1159 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; | 1159 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; |
1160 } | 1160 } |
1161 | 1161 |
1162 } // namespace ui | 1162 } // namespace ui |
OLD | NEW |