From 11397833d1acfc4984cff924024c041aaf580462 Mon Sep 17 00:00:00 2001 From: "iyengar@google.com" Date: Wed, 2 Nov 2011 02:03:05 +0000 Subject: Add support for touch based zoom gesture on Windows. This change also handles the WM_POINTERDOWN and WM_POINTERUP messages to scroll the page if we touch the scrollbar. BUG=none TEST=Touch based zoom should work on Windows. Review URL: http://codereview.chromium.org/8399009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108232 0039d316-1c4b-4281-b951-d872f2087c98 --- .../renderer_host/render_widget_host_view_win.h | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'content/browser/renderer_host/render_widget_host_view_win.h') diff --git a/content/browser/renderer_host/render_widget_host_view_win.h b/content/browser/renderer_host/render_widget_host_view_win.h index 0c09e6f..88b09ee 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.h +++ b/content/browser/renderer_host/render_widget_host_view_win.h @@ -50,6 +50,21 @@ typedef CWinTraits CONTENT_EXPORT extern const wchar_t kRenderWidgetHostHWNDClass[]; +// TODO(ananta) +// This should be removed once we have the new windows SDK which defines these +// messages. +#if !defined(WM_POINTERUPDATE) +#define WM_POINTERUPDATE 0x0245 +#endif // WM_POINTERUPDATE + +#if !defined(WM_POINTERDOWN) +#define WM_POINTERDOWN 0x0246 +#endif // WM_POINTERDOWN + +#if !defined(WM_POINTERUP) +#define WM_POINTERUP 0x0247 +#endif // WM_POINTERUP + /////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewWin // @@ -130,6 +145,8 @@ class RenderWidgetHostViewWin MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) + MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage) + MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage) MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) END_MSG_MAP() @@ -244,6 +261,10 @@ class RenderWidgetHostViewWin LRESULT OnParentNotify(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); + + // Handle the new pointer messages + LRESULT OnPointerMessage(UINT message, WPARAM wparam, LPARAM lparam, + BOOL& handled); // Handle high-level touch events. LRESULT OnGestureEvent(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); @@ -420,6 +441,14 @@ class RenderWidgetHostViewWin ui::Range composition_range_; + // Set to true if the next lbutton down message is to be ignored. Set by the + // WM_POINTERXX handler. We do this to ensure that we don't send out + // duplicate lbutton down messages to the renderer. + bool ignore_next_lbutton_message_at_same_location; + // The location of the last WM_POINTERDOWN message. We ignore the subsequent + // lbutton down only if the locations match. + LPARAM last_pointer_down_location_; + DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); }; -- cgit v1.1