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 #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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 14 #include "ui/base/events.h" |
14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
15 | 16 |
16 // Owns a platform specific event; used to pass own and pass event through | 17 // Owns a platform specific event; used to pass own and pass event through |
17 // platform independent code. | 18 // platform independent code. |
18 struct CONTENT_EXPORT NativeWebKeyboardEvent : | 19 struct CONTENT_EXPORT NativeWebKeyboardEvent : |
19 NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { | 20 NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { |
20 NativeWebKeyboardEvent(); | 21 NativeWebKeyboardEvent(); |
21 | 22 |
22 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); | 23 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); |
23 #if defined(OS_MACOSX) || defined(TOOLKIT_USES_GTK) | 24 #if defined(USE_AURA) |
| 25 NativeWebKeyboardEvent(ui::EventType type, |
| 26 bool is_char, |
| 27 wchar_t character, |
| 28 int state, |
| 29 double time_stamp_seconds); |
| 30 #elif defined(OS_MACOSX) || defined(TOOLKIT_USES_GTK) |
24 // TODO(suzhe): Limit these constructors to Linux native Gtk port. | 31 // TODO(suzhe): Limit these constructors to Linux native Gtk port. |
25 // For Linux Views port, after using RenderWidgetHostViewViews to replace | 32 // For Linux Views port, after using RenderWidgetHostViewViews to replace |
26 // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined | 33 // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined |
27 // below. | 34 // below. |
28 NativeWebKeyboardEvent(wchar_t character, | 35 NativeWebKeyboardEvent(wchar_t character, |
29 int state, | 36 int state, |
30 double time_stamp_seconds); | 37 double time_stamp_seconds); |
31 #endif | 38 #endif |
32 | 39 |
33 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); | 40 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); |
(...skipping 12 matching lines...) Expand all Loading... |
46 | 53 |
47 #if defined(TOOLKIT_USES_GTK) | 54 #if defined(TOOLKIT_USES_GTK) |
48 // True if the key event matches an edit command. In order to ensure the edit | 55 // True if the key event matches an edit command. In order to ensure the edit |
49 // command always work in web page, the browser should not pre-handle this key | 56 // command always work in web page, the browser should not pre-handle this key |
50 // event as a reserved accelerator. See http://crbug.com/54573 | 57 // event as a reserved accelerator. See http://crbug.com/54573 |
51 bool match_edit_command; | 58 bool match_edit_command; |
52 #endif | 59 #endif |
53 }; | 60 }; |
54 | 61 |
55 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 62 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
OLD | NEW |