Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: ui/aura/test/test_screen.cc

Issue 2715513006: Fix showing the sibling menu on mouse move (Closed)
Patch Set: Fix compile error Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/shell/browser/shell_screen.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_screen.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698