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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.h

Issue 8399009: Add support for touch based zoom gesture on Windows. This change also handles the WM_POINTERDOWN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlapp.h> 10 #include <atlapp.h>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace ui { 44 namespace ui {
45 class ViewProp; 45 class ViewProp;
46 } 46 }
47 47
48 typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> 48 typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0>
49 RenderWidgetHostHWNDTraits; 49 RenderWidgetHostHWNDTraits;
50 50
51 CONTENT_EXPORT extern const wchar_t kRenderWidgetHostHWNDClass[]; 51 CONTENT_EXPORT extern const wchar_t kRenderWidgetHostHWNDClass[];
52 52
53 // TODO(ananta)
54 // This should be removed once we have the new windows SDK which defines these
55 // messages.
56 #if !defined(WM_POINTERUPDATE)
57 #define WM_POINTERUPDATE 0x0245
58 #endif // WM_POINTERUPDATE
59
60 #if !defined(WM_POINTERDOWN)
61 #define WM_POINTERDOWN 0x0246
62 #endif // WM_POINTERDOWN
63
64 #if !defined(WM_POINTERUP)
65 #define WM_POINTERUP 0x0247
66 #endif // WM_POINTERUP
67
53 /////////////////////////////////////////////////////////////////////////////// 68 ///////////////////////////////////////////////////////////////////////////////
54 // RenderWidgetHostViewWin 69 // RenderWidgetHostViewWin
55 // 70 //
56 // An object representing the "View" of a rendered web page. This object is 71 // An object representing the "View" of a rendered web page. This object is
57 // responsible for displaying the content of the web page, receiving windows 72 // responsible for displaying the content of the web page, receiving windows
58 // messages, and containing plugins HWNDs. It is the implementation of the 73 // messages, and containing plugins HWNDs. It is the implementation of the
59 // RenderWidgetHostView that the cross-platform RenderWidgetHost object uses 74 // RenderWidgetHostView that the cross-platform RenderWidgetHost object uses
60 // to display the data. 75 // to display the data.
61 // 76 //
62 // Comment excerpted from render_widget_host.h: 77 // Comment excerpted from render_widget_host.h:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 MESSAGE_HANDLER(WM_MOUSEWHEEL, OnWheelEvent) 137 MESSAGE_HANDLER(WM_MOUSEWHEEL, OnWheelEvent)
123 MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnWheelEvent) 138 MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnWheelEvent)
124 MESSAGE_HANDLER(WM_HSCROLL, OnWheelEvent) 139 MESSAGE_HANDLER(WM_HSCROLL, OnWheelEvent)
125 MESSAGE_HANDLER(WM_VSCROLL, OnWheelEvent) 140 MESSAGE_HANDLER(WM_VSCROLL, OnWheelEvent)
126 MESSAGE_HANDLER(WM_CHAR, OnKeyEvent) 141 MESSAGE_HANDLER(WM_CHAR, OnKeyEvent)
127 MESSAGE_HANDLER(WM_SYSCHAR, OnKeyEvent) 142 MESSAGE_HANDLER(WM_SYSCHAR, OnKeyEvent)
128 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent) 143 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent)
129 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) 144 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)
130 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) 145 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject)
131 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) 146 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify)
147 MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage)
148 MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage)
132 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) 149 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent)
133 END_MSG_MAP() 150 END_MSG_MAP()
134 151
135 // Implementation of RenderWidgetHostView: 152 // Implementation of RenderWidgetHostView:
136 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 153 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
137 const gfx::Rect& pos) OVERRIDE; 154 const gfx::Rect& pos) OVERRIDE;
138 virtual void InitAsFullscreen( 155 virtual void InitAsFullscreen(
139 RenderWidgetHostView* reference_host_view) OVERRIDE; 156 RenderWidgetHostView* reference_host_view) OVERRIDE;
140 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; 157 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
141 virtual void DidBecomeSelected() OVERRIDE; 158 virtual void DidBecomeSelected() OVERRIDE;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Handle MSAA requests for accessibility information. 250 // Handle MSAA requests for accessibility information.
234 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam, 251 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam,
235 BOOL& handled); 252 BOOL& handled);
236 // Handle vertical scrolling. 253 // Handle vertical scrolling.
237 LRESULT OnVScroll(int code, short position, HWND scrollbar_control); 254 LRESULT OnVScroll(int code, short position, HWND scrollbar_control);
238 // Handle horizontal scrolling. 255 // Handle horizontal scrolling.
239 LRESULT OnHScroll(int code, short position, HWND scrollbar_control); 256 LRESULT OnHScroll(int code, short position, HWND scrollbar_control);
240 257
241 LRESULT OnParentNotify(UINT message, WPARAM wparam, LPARAM lparam, 258 LRESULT OnParentNotify(UINT message, WPARAM wparam, LPARAM lparam,
242 BOOL& handled); 259 BOOL& handled);
260
261 // Handle the new pointer messages
262 LRESULT OnPointerMessage(UINT message, WPARAM wparam, LPARAM lparam,
263 BOOL& handled);
243 // Handle high-level touch events. 264 // Handle high-level touch events.
244 LRESULT OnGestureEvent(UINT message, WPARAM wparam, LPARAM lparam, 265 LRESULT OnGestureEvent(UINT message, WPARAM wparam, LPARAM lparam,
245 BOOL& handled); 266 BOOL& handled);
246 267
247 void OnFinalMessage(HWND window); 268 void OnFinalMessage(HWND window);
248 269
249 private: 270 private:
250 // Updates the display cursor to the current cursor if the cursor is over this 271 // Updates the display cursor to the current cursor if the cursor is over this
251 // render view. 272 // render view.
252 void UpdateCursorIfOverSelf(); 273 void UpdateCursorIfOverSelf();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // lock was entered. 425 // lock was entered.
405 // Relative to the upper-left corner of the view. 426 // Relative to the upper-left corner of the view.
406 gfx::Point last_mouse_position_; 427 gfx::Point last_mouse_position_;
407 // Relative to the upper-left corner of the screen. 428 // Relative to the upper-left corner of the screen.
408 gfx::Point last_global_mouse_position_; 429 gfx::Point last_global_mouse_position_;
409 430
410 // In the case of the mouse being moved away from the view and then moved 431 // In the case of the mouse being moved away from the view and then moved
411 // back, we regard the mouse movement as (0, 0). 432 // back, we regard the mouse movement as (0, 0).
412 bool ignore_mouse_movement_; 433 bool ignore_mouse_movement_;
413 434
435 // Set to true if the next lbutton down message is to be ignored. Set by the
436 // WM_POINTERXX handler. We do this to ensure that we don't send out
437 // duplicate lbutton down messages to the renderer.
438 bool ignore_next_lbutton_message_at_same_location;
439 // The location of the last WM_POINTERDOWN message. We ignore the subsequent
440 // lbutton down only if the locations match.
441 LPARAM last_pointer_down_location_;
442
414 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); 443 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin);
415 }; 444 };
416 445
417 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 446 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698