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

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

Issue 1433153002: Ignore update cursor messages from blink when the cursor position lies outside our root window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace NULL with nullptr Created 5 years, 1 month 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/gfx/screen_win.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 "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 gfx::Point TestScreen::GetCursorScreenPoint() { 123 gfx::Point TestScreen::GetCursorScreenPoint() {
124 return Env::GetInstance()->last_mouse_location(); 124 return Env::GetInstance()->last_mouse_location();
125 } 125 }
126 126
127 gfx::NativeWindow TestScreen::GetWindowUnderCursor() { 127 gfx::NativeWindow TestScreen::GetWindowUnderCursor() {
128 return GetWindowAtScreenPoint(GetCursorScreenPoint()); 128 return GetWindowAtScreenPoint(GetCursorScreenPoint());
129 } 129 }
130 130
131 gfx::NativeWindow TestScreen::GetWindowAtScreenPoint(const gfx::Point& point) { 131 gfx::NativeWindow TestScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
132 if (!host_ || !host_->window())
133 return nullptr;
132 return host_->window()->GetTopWindowContainingPoint(point); 134 return host_->window()->GetTopWindowContainingPoint(point);
133 } 135 }
134 136
135 int TestScreen::GetNumDisplays() const { 137 int TestScreen::GetNumDisplays() const {
136 return 1; 138 return 1;
137 } 139 }
138 140
139 std::vector<gfx::Display> TestScreen::GetAllDisplays() const { 141 std::vector<gfx::Display> TestScreen::GetAllDisplays() const {
140 return std::vector<gfx::Display>(1, display_); 142 return std::vector<gfx::Display>(1, display_);
141 } 143 }
(...skipping 23 matching lines...) Expand all
165 167
166 TestScreen::TestScreen(const gfx::Rect& screen_bounds) 168 TestScreen::TestScreen(const gfx::Rect& screen_bounds)
167 : host_(NULL), 169 : host_(NULL),
168 ui_scale_(1.0f) { 170 ui_scale_(1.0f) {
169 static int64 synthesized_display_id = 2000; 171 static int64 synthesized_display_id = 2000;
170 display_.set_id(synthesized_display_id++); 172 display_.set_id(synthesized_display_id++);
171 display_.SetScaleAndBounds(1.0f, screen_bounds); 173 display_.SetScaleAndBounds(1.0f, screen_bounds);
172 } 174 }
173 175
174 } // namespace aura 176 } // namespace aura
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/gfx/screen_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698