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

Unified Diff: chrome/browser/ui/views/autofill/autofill_popup_base_view.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
index 28820d8b08488a66043b94b92e5012c68c8758b7..6a79ef4de742ecb819d4b731f86768e3a23c25bd 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
@@ -125,8 +125,8 @@ void AutofillPopupBaseView::OnMouseCaptureLost() {
}
bool AutofillPopupBaseView::OnMouseDragged(const ui::MouseEvent& event) {
- if (HitTestPoint(event.location())) {
- SetSelection(event.location());
+ if (HitTestPoint(gfx::ToFlooredPoint(event.location()))) {
+ SetSelection(gfx::ToFlooredPoint(event.location()));
// We must return true in order to get future OnMouseDragged and
// OnMouseReleased events.
@@ -149,8 +149,8 @@ void AutofillPopupBaseView::OnMouseExited(const ui::MouseEvent& event) {
}
void AutofillPopupBaseView::OnMouseMoved(const ui::MouseEvent& event) {
- if (HitTestPoint(event.location()))
- SetSelection(event.location());
+ if (HitTestPoint(gfx::ToFlooredPoint(event.location())))
+ SetSelection(gfx::ToFlooredPoint(event.location()));
else
ClearSelection();
}
@@ -161,8 +161,9 @@ bool AutofillPopupBaseView::OnMousePressed(const ui::MouseEvent& event) {
void AutofillPopupBaseView::OnMouseReleased(const ui::MouseEvent& event) {
// We only care about the left click.
- if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location()))
- AcceptSelection(event.location());
+ if (event.IsOnlyLeftMouseButton() &&
+ HitTestPoint(gfx::ToFlooredPoint(event.location())))
+ AcceptSelection(gfx::ToFlooredPoint(event.location()));
}
void AutofillPopupBaseView::OnGestureEvent(ui::GestureEvent* event) {
@@ -170,15 +171,15 @@ void AutofillPopupBaseView::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_GESTURE_TAP_DOWN:
case ui::ET_GESTURE_SCROLL_BEGIN:
case ui::ET_GESTURE_SCROLL_UPDATE:
- if (HitTestPoint(event->location()))
- SetSelection(event->location());
+ if (HitTestPoint(gfx::ToFlooredPoint(event->location())))
+ SetSelection(gfx::ToFlooredPoint(event->location()));
else
ClearSelection();
break;
case ui::ET_GESTURE_TAP:
case ui::ET_GESTURE_SCROLL_END:
- if (HitTestPoint(event->location()))
- AcceptSelection(event->location());
+ if (HitTestPoint(gfx::ToFlooredPoint(event->location())))
+ AcceptSelection(gfx::ToFlooredPoint(event->location()));
else
ClearSelection();
break;

Powered by Google App Engine
This is Rietveld 408576698