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

Side by Side Diff: content/browser/renderer_host/input/touch_selection_controller_client_aura.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 2 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
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 "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h" 5 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h"
6 6
7 #include "content/browser/renderer_host/render_widget_host_delegate.h" 7 #include "content/browser/renderer_host/render_widget_host_delegate.h"
8 #include "content/browser/renderer_host/render_widget_host_impl.h" 8 #include "content/browser/renderer_host/render_widget_host_impl.h"
9 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 9 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void TouchSelectionControllerClientAura::ShowQuickMenu() { 158 void TouchSelectionControllerClientAura::ShowQuickMenu() {
159 if (!ui::TouchSelectionMenuRunner::GetInstance()) 159 if (!ui::TouchSelectionMenuRunner::GetInstance())
160 return; 160 return;
161 161
162 gfx::RectF rect = rwhva_->selection_controller()->GetRectBetweenBounds(); 162 gfx::RectF rect = rwhva_->selection_controller()->GetRectBetweenBounds();
163 163
164 // Clip rect, which is in |rwhva_|'s window's coordinate space, to client 164 // Clip rect, which is in |rwhva_|'s window's coordinate space, to client
165 // bounds. 165 // bounds.
166 gfx::PointF origin = rect.origin(); 166 gfx::PointF origin = rect.origin();
167 gfx::PointF bottom_right = rect.bottom_right(); 167 gfx::PointF bottom_right = rect.bottom_right();
168 gfx::Rect client_bounds = rwhva_->GetNativeView()->bounds(); 168 auto client_bounds = gfx::RectF(rwhva_->GetNativeView()->bounds());
169 origin.SetToMax(client_bounds.origin()); 169 origin.SetToMax(client_bounds.origin());
170 bottom_right.SetToMin(client_bounds.bottom_right()); 170 bottom_right.SetToMin(client_bounds.bottom_right());
171 if (origin.x() > bottom_right.x() || origin.y() > bottom_right.y()) 171 if (origin.x() > bottom_right.x() || origin.y() > bottom_right.y())
172 return; 172 return;
173 173
174 gfx::Vector2dF diagonal = bottom_right - origin; 174 gfx::Vector2dF diagonal = bottom_right - origin;
175 gfx::SizeF size(diagonal.x(), diagonal.y()); 175 gfx::SizeF size(diagonal.x(), diagonal.y());
176 gfx::RectF anchor_rect(origin, size); 176 gfx::RectF anchor_rect(origin, size);
177 177
178 // Calculate maximum handle image size; 178 // Calculate maximum handle image size;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 ui::MENU_SOURCE_TOUCH_EDIT_MENU, 344 ui::MENU_SOURCE_TOUCH_EDIT_MENU,
345 gfx::ToRoundedPoint(anchor_point))); 345 gfx::ToRoundedPoint(anchor_point)));
346 346
347 // Hide selection handles after getting rect-between-bounds from touch 347 // Hide selection handles after getting rect-between-bounds from touch
348 // selection controller; otherwise, rect would be empty and the above 348 // selection controller; otherwise, rect would be empty and the above
349 // calculations would be invalid. 349 // calculations would be invalid.
350 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically(); 350 rwhva_->selection_controller()->HideAndDisallowShowingAutomatically();
351 } 351 }
352 352
353 } // namespace content 353 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698