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

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

Issue 44543002: Enable touch for autofill popup view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_popup_view_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
index 1f07bbb0085474802c77c619881ad80a289bd20f..ca83c1bb0a607390328001508a0053e9786291f4 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
@@ -89,7 +89,7 @@ void AutofillPopupViewViews::OnPaint(gfx::Canvas* canvas) {
void AutofillPopupViewViews::OnMouseCaptureLost() {
if (controller_)
- controller_->MouseExitedPopup();
+ controller_->SelectionCleared();
}
bool AutofillPopupViewViews::OnMouseDragged(const ui::MouseEvent& event) {
@@ -97,7 +97,7 @@ bool AutofillPopupViewViews::OnMouseDragged(const ui::MouseEvent& event) {
return false;
if (HitTestPoint(event.location())) {
- controller_->MouseHovered(event.x(), event.y());
+ controller_->LineSelectedAtPoint(event.x(), event.y());
// We must return true in order to get future OnMouseDragged and
// OnMouseReleased events.
@@ -105,13 +105,13 @@ bool AutofillPopupViewViews::OnMouseDragged(const ui::MouseEvent& event) {
}
// If we move off of the popup, we lose the selection.
- controller_->MouseExitedPopup();
+ controller_->SelectionCleared();
return false;
}
void AutofillPopupViewViews::OnMouseExited(const ui::MouseEvent& event) {
if (controller_)
- controller_->MouseExitedPopup();
+ controller_->SelectionCleared();
}
void AutofillPopupViewViews::OnMouseMoved(const ui::MouseEvent& event) {
@@ -119,9 +119,9 @@ void AutofillPopupViewViews::OnMouseMoved(const ui::MouseEvent& event) {
return;
if (HitTestPoint(event.location()))
- controller_->MouseHovered(event.x(), event.y());
+ controller_->LineSelectedAtPoint(event.x(), event.y());
else
- controller_->MouseExitedPopup();
+ controller_->SelectionCleared();
}
bool AutofillPopupViewViews::OnMousePressed(const ui::MouseEvent& event) {
@@ -163,7 +163,37 @@ void AutofillPopupViewViews::OnMouseReleased(const ui::MouseEvent& event) {
// We only care about the left click.
if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location()))
- controller_->MouseClicked(event.x(), event.y());
+ controller_->LineAcceptedAtPoint(event.x(), event.y());
+}
+
+void AutofillPopupViewViews::OnGestureEvent(ui::GestureEvent* event) {
+ if (!controller_)
+ return;
+
+ switch (event->type()) {
+ case ui::ET_GESTURE_TAP_DOWN:
+ case ui::ET_GESTURE_SCROLL_BEGIN:
+ case ui::ET_GESTURE_SCROLL_UPDATE:
+ if (HitTestPoint(event->location()))
+ controller_->LineSelectedAtPoint(event->x(), event->y());
+ else
+ controller_->SelectionCleared();
+ break;
+ case ui::ET_GESTURE_TAP:
+ case ui::ET_GESTURE_SCROLL_END:
+ if (HitTestPoint(event->location()))
+ controller_->LineAcceptedAtPoint(event->x(), event->y());
+ else
+ controller_->SelectionCleared();
+ break;
+ case ui::ET_GESTURE_TAP_CANCEL:
+ case ui::ET_SCROLL_FLING_START:
+ controller_->SelectionCleared();
+ break;
+ default:
+ return;
+ }
+ event->SetHandled();
}
void AutofillPopupViewViews::OnWidgetBoundsChanged(
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_popup_view_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698