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

Side by Side Diff: ash/display/extended_mouse_warp_controller.cc

Issue 2525113002: Rename WindowTreeHost functions to indicate pixels/dips. (Closed)
Patch Set: win Created 4 years 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 | « ash/display/display_util.cc ('k') | ash/display/screen_position_controller.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/display/extended_mouse_warp_controller.h" 5 #include "ash/display/extended_mouse_warp_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "ash/display/display_util.h" 9 #include "ash/display/display_util.h"
10 #include "ash/display/shared_display_edge_indicator.h" 10 #include "ash/display/shared_display_edge_indicator.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 ::wm::ConvertPointToScreen(target, &point_in_screen); 133 ::wm::ConvertPointToScreen(target, &point_in_screen);
134 134
135 // A native event may not exist in unit test. Generate the native point 135 // A native event may not exist in unit test. Generate the native point
136 // from the screen point instead. 136 // from the screen point instead.
137 if (!event->HasNativeEvent()) { 137 if (!event->HasNativeEvent()) {
138 if (!allow_non_native_event_) 138 if (!allow_non_native_event_)
139 return false; 139 return false;
140 aura::Window* target_root = target->GetRootWindow(); 140 aura::Window* target_root = target->GetRootWindow();
141 gfx::Point point_in_native = point_in_screen; 141 gfx::Point point_in_native = point_in_screen;
142 ::wm::ConvertPointFromScreen(target_root, &point_in_native); 142 ::wm::ConvertPointFromScreen(target_root, &point_in_native);
143 target_root->GetHost()->ConvertPointToNativeScreen(&point_in_native); 143 target_root->GetHost()->ConvertDIPToScreenInPixels(&point_in_native);
144 return WarpMouseCursorInNativeCoords(point_in_native, point_in_screen, 144 return WarpMouseCursorInNativeCoords(point_in_native, point_in_screen,
145 true); 145 true);
146 } 146 }
147 147
148 gfx::Point point_in_native = 148 gfx::Point point_in_native =
149 ui::EventSystemLocationFromNative(event->native_event()); 149 ui::EventSystemLocationFromNative(event->native_event());
150 150
151 #if defined(USE_OZONE) 151 #if defined(USE_OZONE)
152 // TODO(dnicoara): crbug.com/415680 Move cursor warping into Ozone once Ozone 152 // TODO(dnicoara): crbug.com/415680 Move cursor warping into Ozone once Ozone
153 // has access to the logical display layout. 153 // has access to the logical display layout.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (drag_source_id == a.id()) 217 if (drag_source_id == a.id())
218 AdjustSourceEdgeBounds(a.bounds(), snap_barrier, &a_edge); 218 AdjustSourceEdgeBounds(a.bounds(), snap_barrier, &a_edge);
219 else if (drag_source_id == b.id()) 219 else if (drag_source_id == b.id())
220 AdjustSourceEdgeBounds(b.bounds(), snap_barrier, &b_edge); 220 AdjustSourceEdgeBounds(b.bounds(), snap_barrier, &b_edge);
221 } 221 }
222 222
223 return base::MakeUnique<WarpRegion>(a.id(), b.id(), a_edge, b_edge); 223 return base::MakeUnique<WarpRegion>(a.id(), b.id(), a_edge, b_edge);
224 } 224 }
225 225
226 } // namespace ash 226 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_util.cc ('k') | ash/display/screen_position_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698