New issue
Advanced search Search tips

Issue 691558 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 671916



Sign in to add a comment

MacViews: Implement three-finger swipes for navigation

Reported by mbl...@yandex-team.ru, Feb 13 2017

Issue description

Steps to reproduce the problem:
Two-finger swipes and three-finger swipes are different:
* two-finger swipes could be tracked, and Chromium already shows an arrow overlay HistoryOverlayController both for Cocoa and MacViews;
* three-finger swipes need to be explicitly enabled in System Preferences, and they're sent as a single -swipeWithEvent:.

https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/EventOverview/HandlingTouchEvents/HandlingTouchEvents.html

What went wrong?
-swipeWithEvent: was handled at BrowserWindowController level in Chromium, but MacViews needs a different solution.

Proposed CL to implement three-finger swipes on MacViews: https://codereview.chromium.org/2690573002/

 

Comment 1 by meh...@chromium.org, Feb 13 2017

Components: Internals>Views
Labels: Proj-MacViews

Comment 2 by tapted@chromium.org, Feb 13 2017

Blocking: 671916
Cc: tapted@chromium.org
Components: -Internals>Views UI>Browser>Navigation
Labels: phase4
Status: Started (was: Unconfirmed)
So on ChromeOS we support a two-finger swipe to navigate back, and there is UI provided for that. That UI is changing (Issue 668296), and actually changing to look more like what we currently do on Mac (neat!).

We should aim to re-use the logic that's being added for ChromeOS for mac_views_browser, but that can be a follow-up - at least for the 3-finger swipe which doesn't currently give feedback on Mac. For two-finger navigate to go back, I'd really like to see us having some kind of UI feedback -- it's too easy to accidentally swipe left/right when scrolling, and that shouldn't tickle navigations.

Work has already started on updating the CrOS UX here - https://codereview.chromium.org/2656463002/.

Note three-finger swipe on CrOS is for switching tabs - it would be nice if we could use that if the "Swipe between pages" pref is only set to the two-finger gesture. However, if we detect #fingers and the pref is set to "swipe with two or three fingers" then I think we can detect that in swipeWithEvent and do the tab-switch UX on three fingers, and the navigate UX on two fingers.
But there already is UI feedback that's exactly the same as in Cocoa version, so I don't think two-finger swiping needs any additional work :-)

P.S. Still working on the CL feedback.
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3

commit fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3
Author: mblsha <mblsha@yandex-team.ru>
Date: Mon Feb 27 13:25:22 2017

MacViews: Handle three-finger swipe gestures for navigation.

It's possible to enable three-finger swipes in System Preferences,
and they result in immediate -swipeWithEvent: calls, unlike two-finger
swipes which should be tracked.

Added code to convert them to ET_GESTURE_SWIPE and to handle them
in BrowserView. Cocoa code handled these events in
BrowserWindowController in a similar fashion.

BUG= 691558 

Review-Url: https://codereview.chromium.org/2690573002
Cr-Commit-Position: refs/heads/master@{#453199}

[modify] https://crrev.com/fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3/chrome/browser/ui/views/frame/browser_view.cc
[modify] https://crrev.com/fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3/chrome/browser/ui/views/frame/browser_view.h
[modify] https://crrev.com/fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3/ui/views/BUILD.gn
[modify] https://crrev.com/fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3/ui/views/cocoa/bridged_content_view.mm
[add] https://crrev.com/fbb7fb60fb7ceaf4f737c638bbd502d26fe129b3/ui/views/view_unittest_mac.mm

This one should also be marked as fixed.

Comment 6 by tapted@chromium.org, Feb 27 2017

Status: Fixed (was: Started)
Thanks!

Sign in to add a comment