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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 404213003: [WIP] Allow scroll events to permanently change the default gesture handler in RootView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: friend test Created 6 years, 5 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/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index c25080761d57a07734094cd71270c39451ef618f..aa45963ef0b693e768627ab0f2026c1e2b8ac9c3 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1083,17 +1083,17 @@ void TabStrip::MaybeStartDrag(
// Use MOVE_VISIBILE_TABS in the following conditions:
// . Mouse event generated from touch and the left button is down (the right
// button corresponds to a long press, which we want to reorder).
- // . Gesture begin and control key isn't down.
+ // . Gesture tap down and control key isn't down.
// . Real mouse event and control is down. This is mostly for testing.
DCHECK(event.type() == ui::ET_MOUSE_PRESSED ||
- event.type() == ui::ET_GESTURE_BEGIN);
+ event.type() == ui::ET_GESTURE_TAP_DOWN);
if (touch_layout_ &&
((event.type() == ui::ET_MOUSE_PRESSED &&
(((event.flags() & ui::EF_FROM_TOUCH) &&
static_cast<const ui::MouseEvent&>(event).IsLeftMouseButton()) ||
(!(event.flags() & ui::EF_FROM_TOUCH) &&
static_cast<const ui::MouseEvent&>(event).IsControlDown()))) ||
- (event.type() == ui::ET_GESTURE_BEGIN && !event.IsControlDown()))) {
+ (event.type() == ui::ET_GESTURE_TAP_DOWN && !event.IsControlDown()))) {
move_behavior = TabDragController::MOVE_VISIBILE_TABS;
}
@@ -2646,7 +2646,6 @@ void TabStrip::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) {
case ui::ET_GESTURE_SCROLL_END:
case ui::ET_SCROLL_FLING_START:
- case ui::ET_GESTURE_END:
EndDrag(END_DRAG_COMPLETE);
if (adjust_layout_) {
SetStackedLayout(true);
@@ -2674,16 +2673,12 @@ void TabStrip::OnGestureEvent(ui::GestureEvent* event) {
ContinueDrag(this, *event);
break;
- case ui::ET_GESTURE_BEGIN:
- EndDrag(END_DRAG_CANCEL);
- break;
-
case ui::ET_GESTURE_TAP: {
const int active_index = controller_->GetActiveIndex();
DCHECK_NE(-1, active_index);
Tab* active_tab = tab_at(active_index);
TouchUMA::GestureActionType action = TouchUMA::GESTURE_TABNOSWITCH_TAP;
- if (active_tab->tab_activated_with_last_gesture_begin())
+ if (active_tab->tab_activated_with_last_tap_down())
action = TouchUMA::GESTURE_TABSWITCH_TAP;
TouchUMA::RecordGestureAction(action);
break;

Powered by Google App Engine
This is Rietveld 408576698