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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return Env::GetInstance()->last_mouse_location(); | 146 return Env::GetInstance()->last_mouse_location(); |
147 } | 147 } |
148 | 148 |
149 bool TestScreen::IsWindowUnderCursor(gfx::NativeWindow window) { | 149 bool TestScreen::IsWindowUnderCursor(gfx::NativeWindow window) { |
150 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; | 150 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; |
151 } | 151 } |
152 | 152 |
153 gfx::NativeWindow TestScreen::GetWindowAtScreenPoint(const gfx::Point& point) { | 153 gfx::NativeWindow TestScreen::GetWindowAtScreenPoint(const gfx::Point& point) { |
154 if (!host_ || !host_->window()) | 154 if (!host_ || !host_->window()) |
155 return nullptr; | 155 return nullptr; |
156 return host_->window()->GetTopWindowContainingPoint(point); | 156 return host_->window()->GetEventHandlerForPoint(point); |
157 } | 157 } |
158 | 158 |
159 display::Display TestScreen::GetDisplayNearestWindow( | 159 display::Display TestScreen::GetDisplayNearestWindow( |
160 gfx::NativeWindow window) const { | 160 gfx::NativeWindow window) const { |
161 return GetPrimaryDisplay(); | 161 return GetPrimaryDisplay(); |
162 } | 162 } |
163 | 163 |
164 TestScreen::TestScreen(const gfx::Rect& screen_bounds, | 164 TestScreen::TestScreen(const gfx::Rect& screen_bounds, |
165 WindowTreeClient* window_tree_client) | 165 WindowTreeClient* window_tree_client) |
166 : host_(nullptr), ui_scale_(1.0f), window_tree_client_(window_tree_client) { | 166 : host_(nullptr), ui_scale_(1.0f), window_tree_client_(window_tree_client) { |
167 static int64_t synthesized_display_id = 2000; | 167 static int64_t synthesized_display_id = 2000; |
168 display::Display display(synthesized_display_id++); | 168 display::Display display(synthesized_display_id++); |
169 display.SetScaleAndBounds(1.0f, screen_bounds); | 169 display.SetScaleAndBounds(1.0f, screen_bounds); |
170 ProcessDisplayChanged(display, true /* is_primary */); | 170 ProcessDisplayChanged(display, true /* is_primary */); |
171 } | 171 } |
172 | 172 |
173 } // namespace aura | 173 } // namespace aura |
OLD | NEW |