| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/common/native_web_keyboard_event.h" | 5 #include "chrome/common/native_web_keyboard_event.h" |
| 6 | 6 |
| 7 #include "webkit/api/public/gtk/WebInputEventFactory.h" | 7 #include "webkit/api/public/gtk/WebInputEventFactory.h" |
| 8 | 8 |
| 9 using WebKit::WebInputEventFactory; | 9 using WebKit::WebInputEventFactory; |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 NativeWebKeyboardEvent::NativeWebKeyboardEvent() | 32 NativeWebKeyboardEvent::NativeWebKeyboardEvent() |
| 33 : os_event(NULL) { | 33 : os_event(NULL) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const GdkEventKey* native_event) | 36 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const GdkEventKey* native_event) |
| 37 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)) { | 37 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)) { |
| 38 CopyEventTo(native_event, &os_event); | 38 CopyEventTo(native_event, &os_event); |
| 39 } | 39 } |
| 40 | 40 |
| 41 NativeWebKeyboardEvent::NativeWebKeyboardEvent(wchar_t character, | 41 NativeWebKeyboardEvent::NativeWebKeyboardEvent(wchar_t character, |
| 42 int state, |
| 42 double time_stamp_seconds) | 43 double time_stamp_seconds) |
| 43 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(character, | 44 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(character, |
| 45 state, |
| 44 time_stamp_seconds)), | 46 time_stamp_seconds)), |
| 45 os_event(NULL) { | 47 os_event(NULL) { |
| 46 } | 48 } |
| 47 | 49 |
| 48 NativeWebKeyboardEvent::NativeWebKeyboardEvent( | 50 NativeWebKeyboardEvent::NativeWebKeyboardEvent( |
| 49 const NativeWebKeyboardEvent& other) : WebKeyboardEvent(other) { | 51 const NativeWebKeyboardEvent& other) : WebKeyboardEvent(other) { |
| 50 CopyEventTo(other.os_event, &os_event); | 52 CopyEventTo(other.os_event, &os_event); |
| 51 } | 53 } |
| 52 | 54 |
| 53 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( | 55 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( |
| 54 const NativeWebKeyboardEvent& other) { | 56 const NativeWebKeyboardEvent& other) { |
| 55 WebKeyboardEvent::operator=(other); | 57 WebKeyboardEvent::operator=(other); |
| 56 | 58 |
| 57 FreeEvent(os_event); | 59 FreeEvent(os_event); |
| 58 CopyEventTo(other.os_event, &os_event); | 60 CopyEventTo(other.os_event, &os_event); |
| 59 return *this; | 61 return *this; |
| 60 } | 62 } |
| 61 | 63 |
| 62 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { | 64 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { |
| 63 FreeEvent(os_event); | 65 FreeEvent(os_event); |
| 64 } | 66 } |
| OLD | NEW |