OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <peninputpanel_i.c> | 9 #include <peninputpanel_i.c> |
10 #include <stack> | 10 #include <stack> |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 // Map to the appropriate window's coordinates. For a root window the | 408 // Map to the appropriate window's coordinates. For a root window the |
409 // coordinates won't change, because the parent shares our rect. | 409 // coordinates won't change, because the parent shares our rect. |
410 POINT client_point = { location.x(), location.y()}; | 410 POINT client_point = { location.x(), location.y()}; |
411 MapWindowPoints(::GetParent(hwnd), hwnd, &client_point, 1); | 411 MapWindowPoints(::GetParent(hwnd), hwnd, &client_point, 1); |
412 POINT screen_point = { location.x(), location.y()}; | 412 POINT screen_point = { location.x(), location.y()}; |
413 MapWindowPoints(hwnd, HWND_DESKTOP, &screen_point, 1); | 413 MapWindowPoints(hwnd, HWND_DESKTOP, &screen_point, 1); |
414 data().x = client_point.x; | 414 data().x = client_point.x; |
415 data().y = client_point.y; | 415 data().y = client_point.y; |
416 data().globalX = screen_point.x; | 416 data().globalX = screen_point.x; |
417 data().globalY = screen_point.y; | 417 data().globalY = screen_point.y; |
418 data().deltaX = details.generic_x(); | |
419 data().deltaY = details.generic_y(); | |
420 data().type = ConvertToWebInputEvent(type_); | 418 data().type = ConvertToWebInputEvent(type_); |
421 data().boundingBox = details.bounding_box(); | 419 data().boundingBox = details.bounding_box(); |
420 | |
421 // Copy any event-type specific data. | |
422 switch (type_) { | |
423 case ui::ET_GESTURE_TAP: | |
424 data().deltaX = details.tap_count(); | |
425 break; | |
426 case ui::ET_GESTURE_SCROLL_UPDATE: | |
427 data().deltaX = details.scroll_x(); | |
428 data().deltaY = details.scroll_y(); | |
429 break; | |
430 case ui::ET_GESTURE_PINCH_UPDATE: | |
431 data().deltaX = details.scale(); | |
sadrul
2012/08/03 01:50:33
I think you need to set velocity for FLING_START
Rick Byers
2012/08/03 14:51:54
Thanks, done. Also added it to the comments in th
| |
432 break; | |
433 default: | |
434 break; | |
435 } | |
422 } | 436 } |
423 | 437 |
424 virtual int GetLowestTouchId() const OVERRIDE { | 438 virtual int GetLowestTouchId() const OVERRIDE { |
425 return LowestBit(touch_ids_bitfield_); | 439 return LowestBit(touch_ids_bitfield_); |
426 } | 440 } |
427 | 441 |
428 ui::EventType type() { | 442 ui::EventType type() { |
429 return type_; | 443 return type_; |
430 } | 444 } |
431 | 445 |
(...skipping 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3148 // receive a focus change in the context of a pointer down message, it means | 3162 // receive a focus change in the context of a pointer down message, it means |
3149 // that the pointer down message occurred on the edit field and we should | 3163 // that the pointer down message occurred on the edit field and we should |
3150 // display the on screen keyboard | 3164 // display the on screen keyboard |
3151 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 3165 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
3152 DisplayOnScreenKeyboardIfNeeded(); | 3166 DisplayOnScreenKeyboardIfNeeded(); |
3153 received_focus_change_after_pointer_down_ = false; | 3167 received_focus_change_after_pointer_down_ = false; |
3154 pointer_down_context_ = false; | 3168 pointer_down_context_ = false; |
3155 } | 3169 } |
3156 | 3170 |
3157 } // namespace content | 3171 } // namespace content |
OLD | NEW |