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

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

Issue 2524873002: Rename WindowTreeHost G|SetBounds to indicate they are in pixels. (Closed)
Patch Set: rebase 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/mirror_window_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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
154 // Native events in Ozone are in the native window coordinate system. We need 154 // Native events in Ozone are in the native window coordinate system. We need
155 // to translate them to get the global position. 155 // to translate them to get the global position.
156 point_in_native.Offset(target->GetHost()->GetBounds().x(), 156 point_in_native.Offset(target->GetHost()->GetBoundsInPixels().x(),
157 target->GetHost()->GetBounds().y()); 157 target->GetHost()->GetBoundsInPixels().y());
158 #endif 158 #endif
159 159
160 return WarpMouseCursorInNativeCoords(point_in_native, point_in_screen, false); 160 return WarpMouseCursorInNativeCoords(point_in_native, point_in_screen, false);
161 } 161 }
162 162
163 void ExtendedMouseWarpController::SetEnabled(bool enabled) { 163 void ExtendedMouseWarpController::SetEnabled(bool enabled) {
164 enabled_ = enabled; 164 enabled_ = enabled;
165 } 165 }
166 166
167 void ExtendedMouseWarpController::AddWarpRegion( 167 void ExtendedMouseWarpController::AddWarpRegion(
(...skipping 49 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/mirror_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698