OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/fake_display_delegate.h" | 5 #include "ui/display/fake_display_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 callback.Run(displays); | 127 callback.Run(displays); |
128 } | 128 } |
129 | 129 |
130 void FakeDisplayDelegate::AddMode(const ui::DisplaySnapshot& output, | 130 void FakeDisplayDelegate::AddMode(const ui::DisplaySnapshot& output, |
131 const ui::DisplayMode* mode) {} | 131 const ui::DisplayMode* mode) {} |
132 | 132 |
133 void FakeDisplayDelegate::Configure(const ui::DisplaySnapshot& output, | 133 void FakeDisplayDelegate::Configure(const ui::DisplaySnapshot& output, |
134 const ui::DisplayMode* mode, | 134 const ui::DisplayMode* mode, |
135 const gfx::Point& origin, | 135 const gfx::Point& origin, |
136 const ui::ConfigureCallback& callback) { | 136 const ui::ConfigureCallback& callback) { |
137 callback.Run(true); | 137 DVLOG(1) << "Configure display id=" << output.display_id() |
| 138 << " with mode=" << (mode ? mode->ToString() : "nullptr") |
| 139 << " and origin=" << origin.ToString(); |
| 140 |
| 141 for (auto& display : displays_) { |
| 142 if (display->display_id() == output.display_id()) { |
| 143 display->set_current_mode(mode); |
| 144 display->set_origin(origin); |
| 145 callback.Run(true); |
| 146 return; |
| 147 } |
| 148 } |
| 149 |
| 150 callback.Run(false); |
138 } | 151 } |
139 | 152 |
140 void FakeDisplayDelegate::CreateFrameBuffer(const gfx::Size& size) {} | 153 void FakeDisplayDelegate::CreateFrameBuffer(const gfx::Size& size) {} |
141 | 154 |
142 void FakeDisplayDelegate::GetHDCPState( | 155 void FakeDisplayDelegate::GetHDCPState( |
143 const ui::DisplaySnapshot& output, | 156 const ui::DisplaySnapshot& output, |
144 const ui::GetHDCPStateCallback& callback) { | 157 const ui::GetHDCPStateCallback& callback) { |
145 callback.Run(false, ui::HDCP_STATE_UNDESIRED); | 158 callback.Run(false, ui::HDCP_STATE_UNDESIRED); |
146 } | 159 } |
147 | 160 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 254 |
242 void FakeDisplayDelegate::OnConfigurationChanged() { | 255 void FakeDisplayDelegate::OnConfigurationChanged() { |
243 if (!initialized_) | 256 if (!initialized_) |
244 return; | 257 return; |
245 | 258 |
246 FOR_EACH_OBSERVER(ui::NativeDisplayObserver, observers_, | 259 FOR_EACH_OBSERVER(ui::NativeDisplayObserver, observers_, |
247 OnConfigurationChanged()); | 260 OnConfigurationChanged()); |
248 } | 261 } |
249 | 262 |
250 } // namespace display | 263 } // namespace display |
OLD | NEW |