diff options
author | rbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-30 17:37:29 +0000 |
---|---|---|
committer | rbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-30 17:37:29 +0000 |
commit | bab38afe71a47e18c441c5789a2d3eb2586cbce2 (patch) | |
tree | 80ceb1f12b0d5a5574beafda499c3546a2d69775 /content/browser/renderer_host/render_widget_host_delegate.h | |
parent | 3c81a89a854294cc77f25813dc6fc6498546c172 (diff) | |
download | chromium_src-bab38afe71a47e18c441c5789a2d3eb2586cbce2.zip chromium_src-bab38afe71a47e18c441c5789a2d3eb2586cbce2.tar.gz chromium_src-bab38afe71a47e18c441c5789a2d3eb2586cbce2.tar.bz2 |
Handle mac trackpad zoom via GesturePinch events
Prior to this change, Mac handles pinch gestures directly in the UI layer (BrowserWindowController). Here we instead have the RenderWidgetHost send GesturePinchUpdate events, and when those events go unhandled WebContentsImpl implements the browser zoom behavior (similar to how it does already for ctrl+mousewheel events on other platforms).
This lays the groundwork in the short term for giving the web page a chance to override the pinch behavior. Longer term this will enable us to hook into the pinch-zoom codepath used for touchscreen so that we can get a similar effect (instead of just browser-zoom - which probably isn't really what the user wants when pinching).
The only observable behavior change in this CL is that pinching outside the content area (eg. in the tabstrip) no longer does anything. It's not clear what the pinch origin should be in such a case, and it probably doesn't really make sense to try to handle it (pinching is supposed to zoom whatever is under the cursor).
This adds some basic unit test coverage for the pre-existing (but untested) logic for mapping pinch scales to zoom in/out actions.
Depends on blink CL: https://src.chromium.org/viewvc/blink?view=rev&revision=168482
BUG=289887
Review URL: https://codereview.chromium.org/181723006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_widget_host_delegate.h')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_delegate.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h index e31975c..983f282 100644 --- a/content/browser/renderer_host/render_widget_host_delegate.h +++ b/content/browser/renderer_host/render_widget_host_delegate.h @@ -52,6 +52,10 @@ class CONTENT_EXPORT RenderWidgetHostDelegate { // Returns true if the |event| was handled. virtual bool PreHandleGestureEvent(const blink::WebGestureEvent& event); + // Callback to inform the browser that the renderer did not process the + // specified gesture event. Returns true if the |event| was handled. + virtual bool HandleGestureEvent(const blink::WebGestureEvent& event); + // Notifies that screen rects were sent to renderer process. virtual void DidSendScreenRects(RenderWidgetHostImpl* rwh) {} |