OLD | NEW |
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 MESSAGE_HANDLER(WM_SYSKEYDOWN, OnKeyEvent) | 134 MESSAGE_HANDLER(WM_SYSKEYDOWN, OnKeyEvent) |
135 MESSAGE_HANDLER(WM_SYSKEYUP, OnKeyEvent) | 135 MESSAGE_HANDLER(WM_SYSKEYUP, OnKeyEvent) |
136 MESSAGE_HANDLER(WM_KEYDOWN, OnKeyEvent) | 136 MESSAGE_HANDLER(WM_KEYDOWN, OnKeyEvent) |
137 MESSAGE_HANDLER(WM_KEYUP, OnKeyEvent) | 137 MESSAGE_HANDLER(WM_KEYUP, OnKeyEvent) |
138 MESSAGE_HANDLER(WM_MOUSEWHEEL, OnWheelEvent) | 138 MESSAGE_HANDLER(WM_MOUSEWHEEL, OnWheelEvent) |
139 MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnWheelEvent) | 139 MESSAGE_HANDLER(WM_MOUSEHWHEEL, OnWheelEvent) |
140 MESSAGE_HANDLER(WM_HSCROLL, OnWheelEvent) | 140 MESSAGE_HANDLER(WM_HSCROLL, OnWheelEvent) |
141 MESSAGE_HANDLER(WM_VSCROLL, OnWheelEvent) | 141 MESSAGE_HANDLER(WM_VSCROLL, OnWheelEvent) |
142 MESSAGE_HANDLER(WM_CHAR, OnKeyEvent) | 142 MESSAGE_HANDLER(WM_CHAR, OnKeyEvent) |
143 MESSAGE_HANDLER(WM_SYSCHAR, OnKeyEvent) | 143 MESSAGE_HANDLER(WM_SYSCHAR, OnKeyEvent) |
144 MESSAGE_HANDLER(WM_TOUCH, OnTouchEvent) | |
145 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent) | 144 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent) |
146 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) | 145 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) |
147 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) | 146 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) |
148 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) | 147 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) |
149 MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage) | 148 MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage) |
150 MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage) | 149 MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage) |
151 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) | 150 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) |
152 END_MSG_MAP() | 151 END_MSG_MAP() |
153 | 152 |
154 // Implementation of RenderWidgetHostView: | 153 // Implementation of RenderWidgetHostView: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 LRESULT OnImeEndComposition( | 240 LRESULT OnImeEndComposition( |
242 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 241 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
243 LRESULT OnImeRequest( | 242 LRESULT OnImeRequest( |
244 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 243 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
245 LRESULT OnMouseEvent( | 244 LRESULT OnMouseEvent( |
246 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 245 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
247 LRESULT OnKeyEvent( | 246 LRESULT OnKeyEvent( |
248 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 247 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
249 LRESULT OnWheelEvent( | 248 LRESULT OnWheelEvent( |
250 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 249 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
251 LRESULT OnTouchEvent( | |
252 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | |
253 LRESULT OnMouseActivate(UINT message, | 250 LRESULT OnMouseActivate(UINT message, |
254 WPARAM wparam, | 251 WPARAM wparam, |
255 LPARAM lparam, | 252 LPARAM lparam, |
256 BOOL& handled); | 253 BOOL& handled); |
257 // Handle MSAA requests for accessibility information. | 254 // Handle MSAA requests for accessibility information. |
258 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam, | 255 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam, |
259 BOOL& handled); | 256 BOOL& handled); |
260 // Handle vertical scrolling. | 257 // Handle vertical scrolling. |
261 LRESULT OnVScroll(int code, short position, HWND scrollbar_control); | 258 LRESULT OnVScroll(int code, short position, HWND scrollbar_control); |
262 // Handle horizontal scrolling. | 259 // Handle horizontal scrolling. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // Represents whether or not this browser process is receiving status | 360 // Represents whether or not this browser process is receiving status |
364 // messages about the focused edit control from a renderer process. | 361 // messages about the focused edit control from a renderer process. |
365 bool ime_notification_; | 362 bool ime_notification_; |
366 | 363 |
367 // true if Enter was hit when render widget host was in focus. | 364 // true if Enter was hit when render widget host was in focus. |
368 bool capture_enter_key_; | 365 bool capture_enter_key_; |
369 | 366 |
370 // true if the View is not visible. | 367 // true if the View is not visible. |
371 bool is_hidden_; | 368 bool is_hidden_; |
372 | 369 |
373 // Wrapper for maintaining touchstate associated with a WebTouchEvent. | |
374 class WebTouchState { | |
375 public: | |
376 explicit WebTouchState(const CWindowImpl* window); | |
377 | |
378 // Updates the current touchpoint state with the supplied touches. | |
379 // Touches will be consumed only if they are of the same type (e.g. down, | |
380 // up, move). Returns the number of consumed touches. | |
381 size_t UpdateTouchPoints(TOUCHINPUT* points, size_t count); | |
382 | |
383 // Marks all active touchpoints as released. | |
384 bool ReleaseTouchPoints(); | |
385 | |
386 // The contained WebTouchEvent. | |
387 const WebKit::WebTouchEvent& touch_event() { return touch_event_; } | |
388 | |
389 // Returns if any touches are modified in the event. | |
390 bool is_changed() { return touch_event_.changedTouchesLength != 0; } | |
391 | |
392 private: | |
393 // Adds a touch point or returns NULL if there's not enough space. | |
394 WebKit::WebTouchPoint* AddTouchPoint(TOUCHINPUT* touch_input); | |
395 | |
396 // Copy details from a TOUCHINPUT to an existing WebTouchPoint, returning | |
397 // true if the resulting point is a stationary move. | |
398 bool UpdateTouchPoint(WebKit::WebTouchPoint* touch_point, | |
399 TOUCHINPUT* touch_input); | |
400 | |
401 WebKit::WebTouchEvent touch_event_; | |
402 const CWindowImpl* const window_; | |
403 }; | |
404 | |
405 // The touch-state. Its touch-points are updated as necessary. A new | |
406 // touch-point is added from an TOUCHEVENTF_DOWN message, and a touch-point | |
407 // is removed from the list on an TOUCHEVENTF_UP message. | |
408 WebTouchState touch_state_; | |
409 | |
410 // True if we're in the midst of a paint operation and should respond to | 370 // True if we're in the midst of a paint operation and should respond to |
411 // DidPaintRect() notifications by merely invalidating. See comments on | 371 // DidPaintRect() notifications by merely invalidating. See comments on |
412 // render_widget_host_view.h:DidPaintRect(). | 372 // render_widget_host_view.h:DidPaintRect(). |
413 bool about_to_validate_and_paint_; | 373 bool about_to_validate_and_paint_; |
414 | 374 |
415 // true if the View should be closed when its HWND is deactivated (used to | 375 // true if the View should be closed when its HWND is deactivated (used to |
416 // support SELECT popups which are closed when they are deactivated). | 376 // support SELECT popups which are closed when they are deactivated). |
417 bool close_on_deactivate_; | 377 bool close_on_deactivate_; |
418 | 378 |
419 // Whether Destroy() has been called. Used to detect a crasher | 379 // Whether Destroy() has been called. Used to detect a crasher |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // duplicate lbutton down messages to the renderer. | 446 // duplicate lbutton down messages to the renderer. |
487 bool ignore_next_lbutton_message_at_same_location; | 447 bool ignore_next_lbutton_message_at_same_location; |
488 // The location of the last WM_POINTERDOWN message. We ignore the subsequent | 448 // The location of the last WM_POINTERDOWN message. We ignore the subsequent |
489 // lbutton down only if the locations match. | 449 // lbutton down only if the locations match. |
490 LPARAM last_pointer_down_location_; | 450 LPARAM last_pointer_down_location_; |
491 | 451 |
492 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 452 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
493 }; | 453 }; |
494 | 454 |
495 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 455 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
OLD | NEW |