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) |
144 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent) | 145 MESSAGE_HANDLER(WM_IME_CHAR, OnKeyEvent) |
145 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) | 146 MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate) |
146 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) | 147 MESSAGE_HANDLER(WM_GETOBJECT, OnGetObject) |
147 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) | 148 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) |
148 MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage) | 149 MESSAGE_HANDLER(WM_POINTERDOWN, OnPointerMessage) |
149 MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage) | 150 MESSAGE_HANDLER(WM_POINTERUP, OnPointerMessage) |
150 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) | 151 MESSAGE_HANDLER(WM_GESTURE, OnGestureEvent) |
151 END_MSG_MAP() | 152 END_MSG_MAP() |
152 | 153 |
153 // Implementation of RenderWidgetHostView: | 154 // Implementation of RenderWidgetHostView: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 LRESULT OnImeEndComposition( | 241 LRESULT OnImeEndComposition( |
241 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 242 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
242 LRESULT OnImeRequest( | 243 LRESULT OnImeRequest( |
243 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 244 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
244 LRESULT OnMouseEvent( | 245 LRESULT OnMouseEvent( |
245 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 246 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
246 LRESULT OnKeyEvent( | 247 LRESULT OnKeyEvent( |
247 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 248 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
248 LRESULT OnWheelEvent( | 249 LRESULT OnWheelEvent( |
249 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 250 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
| 251 LRESULT OnTouchEvent( |
| 252 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
250 LRESULT OnMouseActivate(UINT message, | 253 LRESULT OnMouseActivate(UINT message, |
251 WPARAM wparam, | 254 WPARAM wparam, |
252 LPARAM lparam, | 255 LPARAM lparam, |
253 BOOL& handled); | 256 BOOL& handled); |
254 // Handle MSAA requests for accessibility information. | 257 // Handle MSAA requests for accessibility information. |
255 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam, | 258 LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam, |
256 BOOL& handled); | 259 BOOL& handled); |
257 // Handle vertical scrolling. | 260 // Handle vertical scrolling. |
258 LRESULT OnVScroll(int code, short position, HWND scrollbar_control); | 261 LRESULT OnVScroll(int code, short position, HWND scrollbar_control); |
259 // Handle horizontal scrolling. | 262 // Handle horizontal scrolling. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // Represents whether or not this browser process is receiving status | 363 // Represents whether or not this browser process is receiving status |
361 // messages about the focused edit control from a renderer process. | 364 // messages about the focused edit control from a renderer process. |
362 bool ime_notification_; | 365 bool ime_notification_; |
363 | 366 |
364 // true if Enter was hit when render widget host was in focus. | 367 // true if Enter was hit when render widget host was in focus. |
365 bool capture_enter_key_; | 368 bool capture_enter_key_; |
366 | 369 |
367 // true if the View is not visible. | 370 // true if the View is not visible. |
368 bool is_hidden_; | 371 bool is_hidden_; |
369 | 372 |
| 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 |
370 // True if we're in the midst of a paint operation and should respond to | 410 // True if we're in the midst of a paint operation and should respond to |
371 // DidPaintRect() notifications by merely invalidating. See comments on | 411 // DidPaintRect() notifications by merely invalidating. See comments on |
372 // render_widget_host_view.h:DidPaintRect(). | 412 // render_widget_host_view.h:DidPaintRect(). |
373 bool about_to_validate_and_paint_; | 413 bool about_to_validate_and_paint_; |
374 | 414 |
375 // true if the View should be closed when its HWND is deactivated (used to | 415 // true if the View should be closed when its HWND is deactivated (used to |
376 // support SELECT popups which are closed when they are deactivated). | 416 // support SELECT popups which are closed when they are deactivated). |
377 bool close_on_deactivate_; | 417 bool close_on_deactivate_; |
378 | 418 |
379 // Whether Destroy() has been called. Used to detect a crasher | 419 // Whether Destroy() has been called. Used to detect a crasher |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 // duplicate lbutton down messages to the renderer. | 486 // duplicate lbutton down messages to the renderer. |
447 bool ignore_next_lbutton_message_at_same_location; | 487 bool ignore_next_lbutton_message_at_same_location; |
448 // The location of the last WM_POINTERDOWN message. We ignore the subsequent | 488 // The location of the last WM_POINTERDOWN message. We ignore the subsequent |
449 // lbutton down only if the locations match. | 489 // lbutton down only if the locations match. |
450 LPARAM last_pointer_down_location_; | 490 LPARAM last_pointer_down_location_; |
451 | 491 |
452 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 492 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
453 }; | 493 }; |
454 | 494 |
455 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 495 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
OLD | NEW |