Chromium Code Reviews| 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 |