| 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/test/test_native_display_delegate.h" | 5 #include "ui/display/chromeos/test/test_native_display_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "ui/display/chromeos/test/action_logger.h" | 9 #include "ui/display/chromeos/test/action_logger.h" |
| 10 #include "ui/display/types/display_mode.h" | 10 #include "ui/display/types/display_mode.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 void TestNativeDisplayDelegate::SetBackgroundColor(uint32_t color_argb) { | 51 void TestNativeDisplayDelegate::SetBackgroundColor(uint32_t color_argb) { |
| 52 log_->AppendAction(GetBackgroundAction(color_argb)); | 52 log_->AppendAction(GetBackgroundAction(color_argb)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void TestNativeDisplayDelegate::ForceDPMSOn() { | 55 void TestNativeDisplayDelegate::ForceDPMSOn() { |
| 56 log_->AppendAction(kForceDPMS); | 56 log_->AppendAction(kForceDPMS); |
| 57 } | 57 } |
| 58 | 58 |
| 59 std::vector<DisplaySnapshot*> TestNativeDisplayDelegate::GetDisplays() { | |
| 60 return outputs_; | |
| 61 } | |
| 62 | |
| 63 void TestNativeDisplayDelegate::GetDisplays( | 59 void TestNativeDisplayDelegate::GetDisplays( |
| 64 const GetDisplaysCallback& callback) { | 60 const GetDisplaysCallback& callback) { |
| 65 auto result = GetDisplays(); | |
| 66 if (run_async_) { | 61 if (run_async_) { |
| 67 base::MessageLoop::current()->PostTask(FROM_HERE, | 62 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 68 base::Bind(callback, result)); | 63 base::Bind(callback, outputs_)); |
| 69 } else { | 64 } else { |
| 70 callback.Run(result); | 65 callback.Run(outputs_); |
| 71 } | 66 } |
| 72 } | 67 } |
| 73 | 68 |
| 74 void TestNativeDisplayDelegate::AddMode(const DisplaySnapshot& output, | 69 void TestNativeDisplayDelegate::AddMode(const DisplaySnapshot& output, |
| 75 const DisplayMode* mode) { | 70 const DisplayMode* mode) { |
| 76 log_->AppendAction(GetAddOutputModeAction(output, mode)); | 71 log_->AppendAction(GetAddOutputModeAction(output, mode)); |
| 77 } | 72 } |
| 78 | 73 |
| 79 bool TestNativeDisplayDelegate::Configure(const DisplaySnapshot& output, | 74 bool TestNativeDisplayDelegate::Configure(const DisplaySnapshot& output, |
| 80 const DisplayMode* mode, | 75 const DisplayMode* mode, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 130 |
| 136 void TestNativeDisplayDelegate::AddObserver(NativeDisplayObserver* observer) { | 131 void TestNativeDisplayDelegate::AddObserver(NativeDisplayObserver* observer) { |
| 137 } | 132 } |
| 138 | 133 |
| 139 void TestNativeDisplayDelegate::RemoveObserver( | 134 void TestNativeDisplayDelegate::RemoveObserver( |
| 140 NativeDisplayObserver* observer) { | 135 NativeDisplayObserver* observer) { |
| 141 } | 136 } |
| 142 | 137 |
| 143 } // namespace test | 138 } // namespace test |
| 144 } // namespace ui | 139 } // namespace ui |
| OLD | NEW |