| 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "ui/display/chromeos/apply_content_protection_task.h" | 16 #include "ui/display/chromeos/apply_content_protection_task.h" |
| 17 #include "ui/display/chromeos/display_layout_manager.h" | 17 #include "ui/display/chromeos/display_layout_manager.h" |
| 18 #include "ui/display/chromeos/display_snapshot_virtual.h" | 18 #include "ui/display/chromeos/display_snapshot_virtual.h" |
| 19 #include "ui/display/chromeos/display_util.h" | 19 #include "ui/display/chromeos/display_util.h" |
| 20 #include "ui/display/chromeos/update_display_configuration_task.h" | 20 #include "ui/display/chromeos/update_display_configuration_task.h" |
| 21 #include "ui/display/display.h" |
| 21 #include "ui/display/display_switches.h" | 22 #include "ui/display/display_switches.h" |
| 22 #include "ui/display/types/display_mode.h" | 23 #include "ui/display/types/display_mode.h" |
| 23 #include "ui/display/types/display_snapshot.h" | 24 #include "ui/display/types/display_snapshot.h" |
| 24 #include "ui/display/types/native_display_delegate.h" | 25 #include "ui/display/types/native_display_delegate.h" |
| 25 #include "ui/display/util/display_util.h" | 26 #include "ui/display/util/display_util.h" |
| 26 #include "ui/gfx/display.h" | |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 typedef std::vector<const DisplayMode*> DisplayModeList; | 32 typedef std::vector<const DisplayMode*> DisplayModeList; |
| 33 | 33 |
| 34 // The delay to perform configuration after RRNotify. See the comment for | 34 // The delay to perform configuration after RRNotify. See the comment for |
| 35 // |configure_timer_|. | 35 // |configure_timer_|. |
| 36 const int kConfigureDelayMs = 500; | 36 const int kConfigureDelayMs = 500; |
| (...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 void DisplayConfigurator::NotifyPowerStateObservers() { | 1115 void DisplayConfigurator::NotifyPowerStateObservers() { |
| 1116 FOR_EACH_OBSERVER( | 1116 FOR_EACH_OBSERVER( |
| 1117 Observer, observers_, OnPowerStateChanged(current_power_state_)); | 1117 Observer, observers_, OnPowerStateChanged(current_power_state_)); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 int64_t DisplayConfigurator::AddVirtualDisplay(gfx::Size display_size) { | 1120 int64_t DisplayConfigurator::AddVirtualDisplay(gfx::Size display_size) { |
| 1121 if (last_virtual_display_id_ == 0xff) { | 1121 if (last_virtual_display_id_ == 0xff) { |
| 1122 LOG(WARNING) << "Exceeded virtual display id limit"; | 1122 LOG(WARNING) << "Exceeded virtual display id limit"; |
| 1123 return gfx::Display::kInvalidDisplayID; | 1123 return display::Display::kInvalidDisplayID; |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 DisplaySnapshotVirtual* virtual_snapshot = | 1126 DisplaySnapshotVirtual* virtual_snapshot = |
| 1127 new DisplaySnapshotVirtual(GenerateDisplayID(kReservedManufacturerID, 0x0, | 1127 new DisplaySnapshotVirtual(GenerateDisplayID(kReservedManufacturerID, 0x0, |
| 1128 ++last_virtual_display_id_), | 1128 ++last_virtual_display_id_), |
| 1129 display_size); | 1129 display_size); |
| 1130 virtual_display_snapshots_.push_back(virtual_snapshot); | 1130 virtual_display_snapshots_.push_back(virtual_snapshot); |
| 1131 ConfigureDisplays(); | 1131 ConfigureDisplays(); |
| 1132 | 1132 |
| 1133 return virtual_snapshot->display_id(); | 1133 return virtual_snapshot->display_id(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1154 last_virtual_display_id_ = max_display_id & 0xff; | 1154 last_virtual_display_id_ = max_display_id & 0xff; |
| 1155 | 1155 |
| 1156 return true; | 1156 return true; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 bool DisplayConfigurator::IsDisplayOn() const { | 1159 bool DisplayConfigurator::IsDisplayOn() const { |
| 1160 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; | 1160 return current_power_state_ != chromeos::DISPLAY_POWER_ALL_OFF; |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 } // namespace ui | 1163 } // namespace ui |
| OLD | NEW |