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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/time/time.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 13 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
13 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
14 | 15 |
15 #if defined(OS_ANDROID) | 16 #if defined(OS_ANDROID) |
16 #include "base/android/scoped_java_ref.h" | 17 #include "base/android/scoped_java_ref.h" |
17 #endif | 18 #endif |
18 | 19 |
19 namespace ui { | 20 namespace ui { |
20 class KeyEvent; | 21 class KeyEvent; |
21 } | 22 } |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 | 25 |
25 // Owns a platform specific event; used to pass own and pass event through | 26 // Owns a platform specific event; used to pass own and pass event through |
26 // platform independent code. | 27 // platform independent code. |
27 struct CONTENT_EXPORT NativeWebKeyboardEvent : | 28 struct CONTENT_EXPORT NativeWebKeyboardEvent : |
28 NON_EXPORTED_BASE(public blink::WebKeyboardEvent) { | 29 NON_EXPORTED_BASE(public blink::WebKeyboardEvent) { |
29 NativeWebKeyboardEvent(); | 30 NativeWebKeyboardEvent(blink::WebInputEvent::Type type, |
| 31 int modifiers, |
| 32 base::TimeTicks timestamp); |
| 33 NativeWebKeyboardEvent(blink::WebInputEvent::Type type, |
| 34 int modifiers, |
| 35 double timestampSeconds); |
30 | 36 |
31 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); | 37 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); |
32 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
33 // Holds a global ref to android_key_event (allowed to be null). | 39 // Holds a global ref to android_key_event (allowed to be null). |
34 NativeWebKeyboardEvent( | 40 NativeWebKeyboardEvent( |
35 JNIEnv* env, | 41 JNIEnv* env, |
36 const base::android::JavaRef<jobject>& android_key_event, | 42 const base::android::JavaRef<jobject>& android_key_event, |
37 blink::WebInputEvent::Type type, | 43 blink::WebInputEvent::Type type, |
38 int modifiers, | 44 int modifiers, |
39 double time_secs, | 45 double time_secs, |
(...skipping 20 matching lines...) Expand all Loading... |
60 // renderer. This happens for RawKeyDown events that are created while IME is | 66 // renderer. This happens for RawKeyDown events that are created while IME is |
61 // active and is necessary to prevent backspace from doing "history back" if | 67 // active and is necessary to prevent backspace from doing "history back" if |
62 // it is hit in ime mode. | 68 // it is hit in ime mode. |
63 // Currently, it's only used by Linux and Mac ports. | 69 // Currently, it's only used by Linux and Mac ports. |
64 bool skip_in_browser; | 70 bool skip_in_browser; |
65 }; | 71 }; |
66 | 72 |
67 } // namespace content | 73 } // namespace content |
68 | 74 |
69 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 75 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
OLD | NEW |