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

Unified Diff: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm

Issue 9296040: mac: Always do history swiping on the NTP on lion devices with touchpad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable swipes to the left as well Created 8 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/browser.h » ('j') | chrome/browser/ui/browser.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm
index 206a1a2dd19efca76aff3a8899a2ef73bbd1cf13..298bdd710724c3f127ba900ec014a4cf82e95d92 100644
--- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm
+++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.mm
@@ -170,6 +170,18 @@ class SpellCheckRenderViewObserver : public content::RenderViewHostObserver {
if (isDevtoolsRwhv)
return NO;
+ // TODO(thakis): This is wrong, as it will navigate the frontmost browser
+ // for swipe events on background windows. It also navigates the frontmost
+ // browser for swipes on extensions popups. And it's a dependency problem,
+ // too. http://crbug.com/102541
Robert Sesek 2012/01/30 17:13:18 I think I have a fix for this either today or tomo
Nico 2012/01/30 17:59:22 Heh, I've been looking at this, too. I guess I'll
+ Browser* browser = BrowserList::GetLastActive();
+
+ if (browser && browser->IsOnNtp() &&
+ [NSEvent isSwipeTrackingFromScrollEventsEnabled]) {
+ // Always do history navigation on the NTP if it's enabled.
+ gotUnhandledWheelEvent_ = true;
+ }
+
if (gotUnhandledWheelEvent_ &&
[NSEvent isSwipeTrackingFromScrollEventsEnabled] &&
[theEvent phase] == NSEventPhaseChanged) {
@@ -182,7 +194,7 @@ class SpellCheckRenderViewObserver : public content::RenderViewHostObserver {
bool isRightScroll = [theEvent scrollingDeltaX] < 0;
bool goForward = isRightScroll;
bool canGoBack = false, canGoForward = false;
- if (Browser* browser = BrowserList::GetLastActive()) {
+ if (browser) {
canGoBack = browser->CanGoBack();
canGoForward = browser->CanGoForward();
}
@@ -263,7 +275,7 @@ class SpellCheckRenderViewObserver : public content::RenderViewHostObserver {
return YES;
}
}
- return NO;
+ return gotUnhandledWheelEvent_;
}
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item
« no previous file with comments | « no previous file | chrome/browser/ui/browser.h » ('j') | chrome/browser/ui/browser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698