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

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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
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
jschuh 2011/10/28 01:40:41 Would be good to have a TODO here with a bug for r
ananta 2011/10/28 18:43:10 Done.
53 #if !defined(WM_POINTERUPDATE)
54 #define WM_POINTERUPDATE 0x0245
55 #endif // WM_POINTERUPDATE
56
57 #if !defined(WM_POINTERDOWN)
58 #define WM_POINTERDOWN 0x0246
59 #endif // WM_POINTERDOWN
60
61 #if !defined(WM_POINTERUP)
62 #define WM_POINTERUP 0x0247
63 #endif // WM_POINTERUP
64
53 /////////////////////////////////////////////////////////////////////////////// 65 ///////////////////////////////////////////////////////////////////////////////
54 // RenderWidgetHostViewWin 66 // RenderWidgetHostViewWin
55 // 67 //
56 // An object representing the "View" of a rendered web page. This object is 68 // 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 69 // responsible for displaying the content of the web page, receiving windows
58 // messages, and containing plugins HWNDs. It is the implementation of the 70 // messages, and containing plugins HWNDs. It is the implementation of the
59 // RenderWidgetHostView that the cross-platform RenderWidgetHost object uses 71 // RenderWidgetHostView that the cross-platform RenderWidgetHost object uses
60 // to display the data. 72 // to display the data.
61 // 73 //
62 // Comment excerpted from render_widget_host.h: 74 // 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) 134 MESSAGE_HANDLER(WM_MOUSEWHEEL, OnWheelEvent)
123 MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnWheelEvent) 135 MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnWheelEvent)
124 MESSAGE_HANDLER(WM_HSCROLL, OnWheelEvent) 136 MESSAGE_HANDLER(WM_HSCROLL, OnWheelEvent)
125 MESSAGE_HANDLER(WM_VSCROLL, OnWheelEvent) 137 MESSAGE_HANDLER(WM_VSCROLL, OnWheelEvent)
126 MESSAGE_HANDLER(WM_CHAR, OnKeyEvent) 138 MESSAGE_HANDLER(WM_CHAR, OnKeyEvent)
127 MESSAGE_HANDLER(WM_SYSCHAR, OnKeyEvent) 139 MESSAGE_HANDLER(WM_SYSCHAR, OnKeyEvent)
128 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent) 140 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent)
129 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) 141 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)
130 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) 142 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject)
131 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) 143 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify)
144 MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage)
145 MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage)
132 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) 146 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent)
133 END_MSG_MAP() 147 END_MSG_MAP()
134 148
135 // Implementation of RenderWidgetHostView: 149 // Implementation of RenderWidgetHostView:
136 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 150 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
137 const gfx::Rect& pos) OVERRIDE; 151 const gfx::Rect& pos) OVERRIDE;
138 virtual void InitAsFullscreen( 152 virtual void InitAsFullscreen(
139 RenderWidgetHostView* reference_host_view) OVERRIDE; 153 RenderWidgetHostView* reference_host_view) OVERRIDE;
140 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; 154 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
141 virtual void DidBecomeSelected() OVERRIDE; 155 virtual void DidBecomeSelected() OVERRIDE;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Handle MSAA requests for accessibility information. 247 // Handle MSAA requests for accessibility information.
234 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam, 248 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam,
235 BOOL& handled); 249 BOOL& handled);
236 // Handle vertical scrolling. 250 // Handle vertical scrolling.
237 LRESULT OnVScroll(int code, short position, HWND scrollbar_control); 251 LRESULT OnVScroll(int code, short position, HWND scrollbar_control);
238 // Handle horizontal scrolling. 252 // Handle horizontal scrolling.
239 LRESULT OnHScroll(int code, short position, HWND scrollbar_control); 253 LRESULT OnHScroll(int code, short position, HWND scrollbar_control);
240 254
241 LRESULT OnParentNotify(UINT message, WPARAM wparam, LPARAM lparam, 255 LRESULT OnParentNotify(UINT message, WPARAM wparam, LPARAM lparam,
242 BOOL& handled); 256 BOOL& handled);
257
258 // Handle the new pointer messages
259 LRESULT OnPointerMessage(UINT message, WPARAM wparam, LPARAM lparam,
260 BOOL& handled);
243 // Handle high-level touch events. 261 // Handle high-level touch events.
244 LRESULT OnGestureEvent(UINT message, WPARAM wparam, LPARAM lparam, 262 LRESULT OnGestureEvent(UINT message, WPARAM wparam, LPARAM lparam,
245 BOOL& handled); 263 BOOL& handled);
246 264
247 void OnFinalMessage(HWND window); 265 void OnFinalMessage(HWND window);
248 266
249 private: 267 private:
250 // Updates the display cursor to the current cursor if the cursor is over this 268 // Updates the display cursor to the current cursor if the cursor is over this
251 // render view. 269 // render view.
252 void UpdateCursorIfOverSelf(); 270 void UpdateCursorIfOverSelf();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // lock was entered. 422 // lock was entered.
405 // Relative to the upper-left corner of the view. 423 // Relative to the upper-left corner of the view.
406 gfx::Point last_mouse_position_; 424 gfx::Point last_mouse_position_;
407 // Relative to the upper-left corner of the screen. 425 // Relative to the upper-left corner of the screen.
408 gfx::Point last_global_mouse_position_; 426 gfx::Point last_global_mouse_position_;
409 427
410 // In the case of the mouse being moved away from the view and then moved 428 // 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). 429 // back, we regard the mouse movement as (0, 0).
412 bool ignore_mouse_movement_; 430 bool ignore_mouse_movement_;
413 431
432 // Set to true if the next lbutton down message is to be ignored. Set by the
433 // WM_POINTERXX handler. We do this to ensure that we don't send out
434 // duplicate lbutton down messages to the renderer.
435 bool ignore_next_lbutton_message_at_same_location;
436 // The location of the last WM_POINTERDOWN message. We ignore the subsequent
437 // lbutton down only if the locations match.
438 LPARAM last_pointer_down_location_;
439
414 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); 440 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin);
415 }; 441 };
416 442
417 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 443 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698