| 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 #ifndef CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "third_party/WebKit/public/web/WebInputEvent.h" | 12 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 13 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // Owns a platform specific event; used to pass own and pass event through | 18 // Owns a platform specific event; used to pass own and pass event through |
| 19 // platform independent code. | 19 // platform independent code. |
| 20 struct CONTENT_EXPORT NativeWebKeyboardEvent : | 20 struct CONTENT_EXPORT NativeWebKeyboardEvent : |
| 21 NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { | 21 NON_EXPORTED_BASE(public blink::WebKeyboardEvent) { |
| 22 NativeWebKeyboardEvent(); | 22 NativeWebKeyboardEvent(); |
| 23 | 23 |
| 24 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); | 24 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); |
| 25 #if defined(USE_AURA) | 25 #if defined(USE_AURA) |
| 26 NativeWebKeyboardEvent(ui::EventType type, | 26 NativeWebKeyboardEvent(ui::EventType type, |
| 27 bool is_char, | 27 bool is_char, |
| 28 wchar_t character, | 28 wchar_t character, |
| 29 int state, | 29 int state, |
| 30 double time_stamp_seconds); | 30 double time_stamp_seconds); |
| 31 #elif defined(OS_MACOSX) || defined(TOOLKIT_GTK) | 31 #elif defined(OS_MACOSX) || defined(TOOLKIT_GTK) |
| 32 // TODO(suzhe): Limit these constructors to Linux native Gtk port. | 32 // TODO(suzhe): Limit these constructors to Linux native Gtk port. |
| 33 // For Linux Views port, after using RenderWidgetHostViewViews to replace | 33 // For Linux Views port, after using RenderWidgetHostViewViews to replace |
| 34 // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined | 34 // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined |
| 35 // below. | 35 // below. |
| 36 NativeWebKeyboardEvent(wchar_t character, | 36 NativeWebKeyboardEvent(wchar_t character, |
| 37 int state, | 37 int state, |
| 38 double time_stamp_seconds); | 38 double time_stamp_seconds); |
| 39 #elif defined(OS_ANDROID) | 39 #elif defined(OS_ANDROID) |
| 40 NativeWebKeyboardEvent(WebKit::WebInputEvent::Type type, | 40 NativeWebKeyboardEvent(blink::WebInputEvent::Type type, |
| 41 int modifiers, | 41 int modifiers, |
| 42 double time_secs, | 42 double time_secs, |
| 43 int keycode, | 43 int keycode, |
| 44 int unicode_character, | 44 int unicode_character, |
| 45 bool is_system_key); | 45 bool is_system_key); |
| 46 // Takes ownership of android_key_event. | 46 // Takes ownership of android_key_event. |
| 47 NativeWebKeyboardEvent(jobject android_key_event, | 47 NativeWebKeyboardEvent(jobject android_key_event, |
| 48 WebKit::WebInputEvent::Type type, | 48 blink::WebInputEvent::Type type, |
| 49 int modifiers, | 49 int modifiers, |
| 50 double time_secs, | 50 double time_secs, |
| 51 int keycode, | 51 int keycode, |
| 52 int unicode_character, | 52 int unicode_character, |
| 53 bool is_system_key); | 53 bool is_system_key); |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); | 56 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 57 ~NativeWebKeyboardEvent(); | 57 ~NativeWebKeyboardEvent(); |
| 58 | 58 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 75 #endif | 75 #endif |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 // Returns a bitmak of values from ui/events/event_constants.h. | 78 // Returns a bitmak of values from ui/events/event_constants.h. |
| 79 CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( | 79 CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( |
| 80 const NativeWebKeyboardEvent& event); | 80 const NativeWebKeyboardEvent& event); |
| 81 | 81 |
| 82 } // namespace content | 82 } // namespace content |
| 83 | 83 |
| 84 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 84 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| OLD | NEW |