| 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 #include "content/public/browser/native_web_keyboard_event.h" | 5 #include "content/public/browser/native_web_keyboard_event.h" |
| 6 | 6 |
| 7 #include "third_party/WebKit/public/web/win/WebInputEventFactory.h" | 7 #include "content/browser/renderer_host/input/web_input_event_builders_win.h" |
| 8 | 8 |
| 9 using WebKit::WebInputEventFactory; | |
| 10 using WebKit::WebKeyboardEvent; | 9 using WebKit::WebKeyboardEvent; |
| 11 | 10 |
| 12 namespace content { | 11 namespace content { |
| 13 | 12 |
| 14 NativeWebKeyboardEvent::NativeWebKeyboardEvent() | 13 NativeWebKeyboardEvent::NativeWebKeyboardEvent() |
| 15 : skip_in_browser(false) { | 14 : skip_in_browser(false) { |
| 16 memset(&os_event, 0, sizeof(os_event)); | 15 memset(&os_event, 0, sizeof(os_event)); |
| 17 } | 16 } |
| 18 | 17 |
| 19 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) | 18 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) |
| 20 : WebKeyboardEvent( | 19 : WebKeyboardEvent( |
| 21 WebInputEventFactory::keyboardEvent(native_event.hwnd, | 20 WebKeyboardEventBuilder::Build(native_event.hwnd, |
| 22 native_event.message, | 21 native_event.message, |
| 23 native_event.wParam, | 22 native_event.wParam, |
| 24 native_event.lParam)), | 23 native_event.lParam)), |
| 25 os_event(native_event), | 24 os_event(native_event), |
| 26 skip_in_browser(false) { | 25 skip_in_browser(false) { |
| 27 } | 26 } |
| 28 | 27 |
| 29 NativeWebKeyboardEvent::NativeWebKeyboardEvent( | 28 NativeWebKeyboardEvent::NativeWebKeyboardEvent( |
| 30 const NativeWebKeyboardEvent& other) | 29 const NativeWebKeyboardEvent& other) |
| 31 : WebKeyboardEvent(other), | 30 : WebKeyboardEvent(other), |
| 32 os_event(other.os_event), | 31 os_event(other.os_event), |
| 33 skip_in_browser(other.skip_in_browser) { | 32 skip_in_browser(other.skip_in_browser) { |
| 34 } | 33 } |
| 35 | 34 |
| 36 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( | 35 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( |
| 37 const NativeWebKeyboardEvent& other) { | 36 const NativeWebKeyboardEvent& other) { |
| 38 WebKeyboardEvent::operator=(other); | 37 WebKeyboardEvent::operator=(other); |
| 39 | 38 |
| 40 os_event = other.os_event; | 39 os_event = other.os_event; |
| 41 skip_in_browser = other.skip_in_browser; | 40 skip_in_browser = other.skip_in_browser; |
| 42 | 41 |
| 43 return *this; | 42 return *this; |
| 44 } | 43 } |
| 45 | 44 |
| 46 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { | 45 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { |
| 47 // Noop under windows | 46 // Noop under windows |
| 48 } | 47 } |
| 49 | 48 |
| 50 } // namespace content | 49 } // namespace content |
| OLD | NEW |