| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/display_manager_test_api.h" | 5 #include "ui/display/test/display_manager_test_api.h" |
| 6 | 6 |
| 7 #include <cstdarg> | 7 #include <cstdarg> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 const display::ManagedDisplayInfo& info = | 134 const display::ManagedDisplayInfo& info = |
| 135 display_manager_->GetDisplayInfo(id); | 135 display_manager_->GetDisplayInfo(id); |
| 136 | 136 |
| 137 scoped_refptr<display::ManagedDisplayMode> mode = | 137 scoped_refptr<display::ManagedDisplayMode> mode = |
| 138 GetDisplayModeForUIScale(info, ui_scale); | 138 GetDisplayModeForUIScale(info, ui_scale); |
| 139 if (!mode) | 139 if (!mode) |
| 140 return false; | 140 return false; |
| 141 return display_manager_->SetDisplayMode(id, mode); | 141 return display_manager_->SetDisplayMode(id, mode); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void DisplayManagerTestApi::SetTouchSupport( |
| 145 int64_t display_id, |
| 146 display::Display::TouchSupport touch_support) { |
| 147 display_manager_->FindDisplayForId(display_id) |
| 148 ->set_touch_support(touch_support); |
| 149 } |
| 150 |
| 144 ScopedDisable125DSFForUIScaling::ScopedDisable125DSFForUIScaling() { | 151 ScopedDisable125DSFForUIScaling::ScopedDisable125DSFForUIScaling() { |
| 145 display::ManagedDisplayInfo::SetUse125DSFForUIScalingForTest(false); | 152 display::ManagedDisplayInfo::SetUse125DSFForUIScalingForTest(false); |
| 146 } | 153 } |
| 147 | 154 |
| 148 ScopedDisable125DSFForUIScaling::~ScopedDisable125DSFForUIScaling() { | 155 ScopedDisable125DSFForUIScaling::~ScopedDisable125DSFForUIScaling() { |
| 149 display::ManagedDisplayInfo::SetUse125DSFForUIScalingForTest(true); | 156 display::ManagedDisplayInfo::SetUse125DSFForUIScalingForTest(true); |
| 150 } | 157 } |
| 151 | 158 |
| 152 ScopedSetInternalDisplayId::ScopedSetInternalDisplayId( | 159 ScopedSetInternalDisplayId::ScopedSetInternalDisplayId( |
| 153 DisplayManager* display_manager, | 160 DisplayManager* display_manager, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 for (size_t i = 0; i < count; i++) { | 204 for (size_t i = 0; i < count; i++) { |
| 198 int64_t id = va_arg(args, int64_t); | 205 int64_t id = va_arg(args, int64_t); |
| 199 list.push_back(id); | 206 list.push_back(id); |
| 200 } | 207 } |
| 201 display::SortDisplayIdList(&list); | 208 display::SortDisplayIdList(&list); |
| 202 return list; | 209 return list; |
| 203 } | 210 } |
| 204 | 211 |
| 205 } // namespace test | 212 } // namespace test |
| 206 } // namespace display | 213 } // namespace display |
| OLD | NEW |