| 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/aura/test/test_screen.h" | 5 #include "ui/aura/test/test_screen.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 int TestScreen::GetNumDisplays() const { | 152 int TestScreen::GetNumDisplays() const { |
| 153 return 1; | 153 return 1; |
| 154 } | 154 } |
| 155 | 155 |
| 156 std::vector<display::Display> TestScreen::GetAllDisplays() const { | 156 std::vector<display::Display> TestScreen::GetAllDisplays() const { |
| 157 return std::vector<display::Display>(1, display_); | 157 return std::vector<display::Display>(1, display_); |
| 158 } | 158 } |
| 159 | 159 |
| 160 display::Display TestScreen::GetDisplayNearestWindow( | 160 display::Display TestScreen::GetDisplayNearestWindow( |
| 161 gfx::NativeWindow window) const { | 161 const gfx::NativeWindow window) const { |
| 162 return display_; | 162 return display_; |
| 163 } | 163 } |
| 164 | 164 |
| 165 display::Display TestScreen::GetDisplayNearestPoint( | 165 display::Display TestScreen::GetDisplayNearestPoint( |
| 166 const gfx::Point& point) const { | 166 const gfx::Point& point) const { |
| 167 return display_; | 167 return display_; |
| 168 } | 168 } |
| 169 | 169 |
| 170 display::Display TestScreen::GetDisplayMatching( | 170 display::Display TestScreen::GetDisplayMatching( |
| 171 const gfx::Rect& match_rect) const { | 171 const gfx::Rect& match_rect) const { |
| 172 return display_; | 172 return display_; |
| 173 } | 173 } |
| 174 | 174 |
| 175 void TestScreen::AddObserver(display::DisplayObserver* observer) {} | 175 void TestScreen::AddObserver(display::DisplayObserver* observer) {} |
| 176 | 176 |
| 177 void TestScreen::RemoveObserver(display::DisplayObserver* observer) {} | 177 void TestScreen::RemoveObserver(display::DisplayObserver* observer) {} |
| 178 | 178 |
| 179 TestScreen::TestScreen(const gfx::Rect& screen_bounds, | 179 TestScreen::TestScreen(const gfx::Rect& screen_bounds, |
| 180 WindowTreeClient* window_tree_client) | 180 WindowTreeClient* window_tree_client) |
| 181 : host_(nullptr), ui_scale_(1.0f), window_tree_client_(window_tree_client) { | 181 : host_(nullptr), ui_scale_(1.0f), window_tree_client_(window_tree_client) { |
| 182 static int64_t synthesized_display_id = 2000; | 182 static int64_t synthesized_display_id = 2000; |
| 183 display_.set_id(synthesized_display_id++); | 183 display_.set_id(synthesized_display_id++); |
| 184 display_.SetScaleAndBounds(1.0f, screen_bounds); | 184 display_.SetScaleAndBounds(1.0f, screen_bounds); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace aura | 187 } // namespace aura |
| OLD | NEW |