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

Issue 7618036: mac: Only let two-finger-scrolling trigger history if web doesn't swallow gesture (Closed)

Created:
9 years, 4 months ago by Nico
Modified:
9 years, 4 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, jam, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

mac: Only let two-finger-scrolling trigger history if web doesn't swallow gesture Use the intended APIs for swipe tracking. Remove the old, wrong, and now unneeded two-finger swipe detection code. Make target 'browser' depend on the block support target, since this is the first CL that uses ObjC blocks (only on 10.7). No UI yet. Approach: * Scroll events are always first sent to the renderer * RWH informs its view if a wheel event came back unhandled * If a scroll event came back, and the viewport is pinned to the left or there is no horizontal scrollbar, a back navigation is triggered * If a scroll event came back, and the viewport is pinned to the right or there is no horizontal scrollbar, a forward navigation is triggered Depends on https://bugs.webkit.org/show_bug.cgi?id=66206 BUG=91513, 90652, 92786, 90228, 91144 TEST= 1.) Open http://en.wikipedia.org/wiki/Main_Page , then click a link and go back (so that back and forward buttons are active). Swiping left should go back, swiping right should go forward. Make browser window narrow so that horizontal scroller appears. Now sliding should scroll first if not at the edge, and trigger history if the viewport is on an edge at gesture start. 2.) Open http://pastie.org/2371939 . Scrolling over the div shouldn't trigger history, scrolling everywhere else should (or if there's no history, bounce instead) 3.) Open http://maps.google.com/ . Scrolling over the map area shouldn't trigger history, scrolling over the search box should. 4.) Open http://itunes.apple.com/us/app/cut-the-rope/id380293530?mt=8 Scrollling over the screenshot area should move screenshots (slowly), should tigger history (or bounce) everywhere else. 5.) With the back button active but the forward button inactive, going left/right/left/right in a single gesture should toggle between history on the left and bouncing on the right seamlessly. Test this with an MBP, a magic trackpad, a magic mouse, and with scroll directions set to "natural" on and off in sysprefs. Also set "Swipe between pages" to three fingers and check if that works, and disable it and check that it's disabled. Also check that the behavior on 10.5/10.6 and the behavior of mouses with conventional scroll wheels didn't change. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=96865

Patch Set 1 #

Patch Set 2 : functional, no ui #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Total comments: 36

Patch Set 6 : comments #

Total comments: 8

Patch Set 7 : mark2 #

Total comments: 2

Patch Set 8 : pure virtual #

Patch Set 9 : TestRenderViewHost #

Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -223 lines) Patch
M chrome/browser/renderer_host/render_widget_host_view_gtk.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.h View 1 2 3 4 5 2 chunks +30 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 8 chunks +136 lines, -10 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_views.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_views.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 3 4 5 3 chunks +0 lines, -118 lines 0 comments Download
D chrome/browser/ui/cocoa/gesture_utils.h View 1 2 1 chunk +0 lines, -22 lines 0 comments Download
D chrome/browser/ui/cocoa/gesture_utils.mm View 1 2 1 chunk +0 lines, -64 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host.h View 3 chunks +6 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host.cc View 5 chunks +13 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/test_render_view_host.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Nico
http://codereview.chromium.org/7647015 will make the NTP work well with this. Amazingly, this removes 26 lines more ...
9 years, 4 months ago (2011-08-15 04:14:45 UTC) #1
Nico
Trybot error is "__NSConcreteStackBlock", referenced from: __NSConcreteStackBlock$non_lazy_ptr in libbrowser.a(render_widget_host_view_mac.o) (maybe you meant: __NSConcreteStackBlock$non_lazy_ptr) Is it ...
9 years, 4 months ago (2011-08-15 04:47:34 UTC) #2
Mark Mentovai
Try job log was http://build.chromium.org/p/tryserver.chromium/builders/mac/builds/43081/steps/compile/logs/stdio (Please include the link in the future. You started a ...
9 years, 4 months ago (2011-08-15 04:59:41 UTC) #3
Nico
Yes, looks like that was an old tryjob result. The current result looks good. On ...
9 years, 4 months ago (2011-08-15 14:34:33 UTC) #4
Mark Mentovai
This looks great. http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.h File chrome/browser/renderer_host/render_widget_host_view_mac.h (right): http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.h#newcode123 chrome/browser/renderer_host/render_widget_host_view_mac.h:123: BOOL gotUnhandledWheelEvent_; Document which of these ...
9 years, 4 months ago (2011-08-15 14:43:57 UTC) #5
Robert Sesek
http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm#newcode82 chrome/browser/renderer_host/render_widget_host_view_mac.mm:82: @interface NSEvent(LionAPI) nit: space before ( http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm#newcode1574 chrome/browser/renderer_host/render_widget_host_view_mac.mm:1574: if ...
9 years, 4 months ago (2011-08-15 14:46:27 UTC) #6
Robert Sesek
Aaaand Mark beats me by a minute. Sorry for the dupe comments.
9 years, 4 months ago (2011-08-15 14:46:49 UTC) #7
Mark Mentovai
Wow, that’s over 50% comment duplication. The system works!
9 years, 4 months ago (2011-08-15 15:10:26 UTC) #8
Alexei Svitkine (slow)
http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm#newcode1299 chrome/browser/renderer_host/render_widget_host_view_mac.mm:1299: [[self nextResponder] beginGestureWithEvent:event]; Since the browser controller now won't ...
9 years, 4 months ago (2011-08-15 15:58:42 UTC) #9
Nico
http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/7618036/diff/2005/chrome/browser/renderer_host/render_widget_host_view_mac.mm#newcode82 chrome/browser/renderer_host/render_widget_host_view_mac.mm:82: @interface NSEvent(LionAPI) On 2011/08/15 14:46:27, rsesek wrote: > nit: ...
9 years, 4 months ago (2011-08-15 16:39:46 UTC) #10
Mark Mentovai
LGTM with these minor things cleaned up. http://codereview.chromium.org/7618036/diff/3013/chrome/browser/renderer_host/render_widget_host_view_mac.mm File chrome/browser/renderer_host/render_widget_host_view_mac.mm (left): http://codereview.chromium.org/7618036/diff/3013/chrome/browser/renderer_host/render_widget_host_view_mac.mm#oldcode1237 chrome/browser/renderer_host/render_widget_host_view_mac.mm:1237: [[self nextResponder] ...
9 years, 4 months ago (2011-08-15 16:55:36 UTC) #11
Mark Mentovai
The test= should also specify that you should try this with conventional wheel mice to ...
9 years, 4 months ago (2011-08-15 16:57:38 UTC) #12
Nico
updated TEST= http://codereview.chromium.org/7618036/diff/3013/chrome/browser/renderer_host/render_widget_host_view_mac.mm File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/7618036/diff/3013/chrome/browser/renderer_host/render_widget_host_view_mac.mm#newcode64 chrome/browser/renderer_host/render_widget_host_view_mac.mm:64: // Forward-declare symbols that are part of ...
9 years, 4 months ago (2011-08-15 17:05:30 UTC) #13
Mark Mentovai
LGTM still. http://codereview.chromium.org/7618036/diff/3013/chrome/browser/renderer_host/render_widget_host_view_mac.mm File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/7618036/diff/3013/chrome/browser/renderer_host/render_widget_host_view_mac.mm#newcode1574 chrome/browser/renderer_host/render_widget_host_view_mac.mm:1574: std::abs(totalScrollDelta_.width) > std::abs(totalScrollDelta_.height); Nico wrote: > Yes, ...
9 years, 4 months ago (2011-08-15 17:58:24 UTC) #14
Nico
+jam for contents/ approval
9 years, 4 months ago (2011-08-15 18:30:17 UTC) #15
jam
http://codereview.chromium.org/7618036/diff/5022/content/browser/renderer_host/render_widget_host_view.h File content/browser/renderer_host/render_widget_host_view.h (right): http://codereview.chromium.org/7618036/diff/5022/content/browser/renderer_host/render_widget_host_view.h#newcode300 content/browser/renderer_host/render_widget_host_view.h:300: virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) {} it looks like ...
9 years, 4 months ago (2011-08-15 19:54:54 UTC) #16
Nico
Done. (discussion below was completed on IRC) http://codereview.chromium.org/7618036/diff/5022/content/browser/renderer_host/render_widget_host_view.h File content/browser/renderer_host/render_widget_host_view.h (right): http://codereview.chromium.org/7618036/diff/5022/content/browser/renderer_host/render_widget_host_view.h#newcode300 content/browser/renderer_host/render_widget_host_view.h:300: virtual void ...
9 years, 4 months ago (2011-08-15 20:11:52 UTC) #17
jam
lgtm
9 years, 4 months ago (2011-08-15 20:14:23 UTC) #18
commit-bot: I haz the power
Commit queue patch verification failed without an error message. Something went wrong, probably a crash, ...
9 years, 4 months ago (2011-08-15 20:28:52 UTC) #19
M-A Ruel
9 years, 4 months ago (2011-08-15 20:32:48 UTC) #20
Found the bug, checked the commit bit again.

Powered by Google App Engine
This is Rietveld 408576698