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

Issue 10092017: Mac: Prevent NTP mousewheel events from being suppressed on Lion. (Closed)

Created:
8 years, 8 months ago by Patrick Dubroy
Modified:
8 years, 8 months ago
CC:
chromium-reviews, Robert Sesek
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Mac: Prevent NTP mousewheel events from being suppressed on Lion. On Lion, when the "two-finger page swipe" system preference is enabled, horizontal scrolling should never trigger NTP page flipping -- it should always mean back/forward navigation. https://chromiumcodereview.appspot.com/9296040/ implemented this by suppressing mousewheel events on the NTP. However, this prevents containers with vertical scrollbars (e.g. the Other Devices menu) from being scrolling. This fix reverts most of that change, and instead places the logic in the NTP. BUG=120191 TEST=Manual. On a non-Lion machine, scrolling left and right should always flip between NTP pages. On Lion, when the pref is turned on, it should trigger back and forward navigation. Turn the pref off, reload the NTP, and ensure that scrolling flips between pages again. In all cases, vertical scrolling on the NTP should still work (shrink the window vertically and the NTP will get a vertical scroll bar). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=133020

Patch Set 1 #

Total comments: 3

Patch Set 2 : Finished pathc. #

Patch Set 3 : Whoops - send message to class, not metaclass. #

Total comments: 1

Patch Set 4 : Fix scrolling when over page switcher. #

Total comments: 16

Patch Set 5 : Address reviewer comments. #

Total comments: 4

Patch Set 6 : Fix grammar & style. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -54 lines) Patch
M chrome/browser/platform_util.h View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/platform_util_mac.mm View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm View 2 chunks +2 lines, -12 lines 0 comments Download
M chrome/browser/resources/ntp4/page_list_view.js View 1 2 3 4 5 3 chunks +18 lines, -4 lines 0 comments Download
M chrome/browser/resources/ntp4/page_switcher.js View 1 2 chunks +0 lines, -13 lines 0 comments Download
M chrome/browser/resources/ntp4/tile_page.js View 1 2 3 4 2 chunks +10 lines, -18 lines 0 comments Download
M chrome/browser/resources/shared/js/cr/ui/card_slider.js View 1 2 3 3 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_resource_cache.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_resource_cache.cc View 1 2 3 4 5 3 chunks +26 lines, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
Patrick Dubroy
This CL is still missing a few things, but can you guys take a look ...
8 years, 8 months ago (2012-04-16 21:24:05 UTC) #1
Patrick Dubroy
http://codereview.chromium.org/10092017/diff/1/chrome/browser/resources/ntp4/page_switcher.js File chrome/browser/resources/ntp4/page_switcher.js (right): http://codereview.chromium.org/10092017/diff/1/chrome/browser/resources/ntp4/page_switcher.js#newcode22 chrome/browser/resources/ntp4/page_switcher.js:22: // el.addEventListener('mousewheel', el.onMouseWheel_); This should have a bool value ...
8 years, 8 months ago (2012-04-16 21:27:58 UTC) #2
Evan Stade
this direction seems ok to me
8 years, 8 months ago (2012-04-16 21:48:52 UTC) #3
Patrick Dubroy
Alright, this is ready for review -- please take a look. This is currently marked ...
8 years, 8 months ago (2012-04-17 17:28:23 UTC) #4
Robert Sesek
This approach is good by me. http://codereview.chromium.org/10092017/diff/4002/base/mac/mac_util.h File base/mac/mac_util.h (right): http://codereview.chromium.org/10092017/diff/4002/base/mac/mac_util.h#newcode213 base/mac/mac_util.h:213: BASE_EXPORT bool IsSwipeTrackingFromScrollEventsEnabled(); ...
8 years, 8 months ago (2012-04-17 17:38:51 UTC) #5
sky
LGTM
8 years, 8 months ago (2012-04-17 17:54:20 UTC) #6
Evan Stade
http://codereview.chromium.org/10092017/diff/4002/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc File chrome/browser/ui/webui/ntp/ntp_resource_cache.cc (right): http://codereview.chromium.org/10092017/diff/4002/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc#newcode203 chrome/browser/ui/webui/ntp/ntp_resource_cache.cc:203: bool NTPResourceCache::InvalidateNewTabCache() { s/InvalidateNewTabCache/NewTabCacheNeedsRefresh/g (InvalidateNewTabCache sounds like a verb ...
8 years, 8 months ago (2012-04-17 21:29:53 UTC) #7
Nico
http://codereview.chromium.org/10092017/diff/4002/base/mac/mac_util.h File base/mac/mac_util.h (right): http://codereview.chromium.org/10092017/diff/4002/base/mac/mac_util.h#newcode213 base/mac/mac_util.h:213: BASE_EXPORT bool IsSwipeTrackingFromScrollEventsEnabled(); On 2012/04/17 17:38:51, rsesek wrote: > ...
8 years, 8 months ago (2012-04-17 23:22:35 UTC) #8
Patrick Dubroy
Ok, I've addressed all the comments. Please have another look. Since Nico pointed out that ...
8 years, 8 months ago (2012-04-18 14:43:06 UTC) #9
Nico
lgtm Thanks for taking care of this!
8 years, 8 months ago (2012-04-18 14:53:59 UTC) #10
Evan Stade
lgtm http://codereview.chromium.org/10092017/diff/9004/chrome/browser/resources/ntp4/page_list_view.js File chrome/browser/resources/ntp4/page_list_view.js (right): http://codereview.chromium.org/10092017/diff/9004/chrome/browser/resources/ntp4/page_list_view.js#newcode192 chrome/browser/resources/ntp4/page_list_view.js:192: e.preventDefault(); // Prevent default scroll behavior. two spaces ...
8 years, 8 months ago (2012-04-18 21:16:35 UTC) #11
Patrick Dubroy
8 years, 8 months ago (2012-04-19 10:53:49 UTC) #12
http://codereview.chromium.org/10092017/diff/9004/chrome/browser/resources/nt...
File chrome/browser/resources/ntp4/page_list_view.js (right):

http://codereview.chromium.org/10092017/diff/9004/chrome/browser/resources/nt...
chrome/browser/resources/ntp4/page_list_view.js:192: e.preventDefault(); //
Prevent default scroll behavior.
On 2012/04/18 21:16:35, Evan Stade wrote:
> two spaces before comment

Done.

http://codereview.chromium.org/10092017/diff/9004/chrome/browser/ui/webui/ntp...
File chrome/browser/ui/webui/ntp/ntp_resource_cache.cc (right):

http://codereview.chromium.org/10092017/diff/9004/chrome/browser/ui/webui/ntp...
chrome/browser/ui/webui/ntp/ntp_resource_cache.cc:222: // HTML is fetched,
because it needs to initialized cached values.
On 2012/04/18 21:16:35, Evan Stade wrote:
> grammar

Done.

Powered by Google App Engine
This is Rietveld 408576698