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_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ | 5 #ifndef CONTENT_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ |
6 #define CONTENT_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ | 6 #define CONTENT_COMMON_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 "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "content/common/content_export.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
12 | 14 |
13 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
14 #include <windows.h> | 16 #include <windows.h> |
15 #elif defined(OS_MACOSX) | 17 #elif defined(OS_MACOSX) |
16 #ifdef __OBJC__ | 18 #ifdef __OBJC__ |
17 @class NSEvent; | 19 @class NSEvent; |
18 #else | 20 #else |
19 class NSEvent; | 21 class NSEvent; |
20 #endif // __OBJC__ | 22 #endif // __OBJC__ |
21 #elif defined(OS_POSIX) | 23 #elif defined(OS_POSIX) |
22 typedef struct _GdkEventKey GdkEventKey; | 24 typedef struct _GdkEventKey GdkEventKey; |
23 #endif | 25 #endif |
24 | 26 |
25 // Owns a platform specific event; used to pass own and pass event through | 27 // Owns a platform specific event; used to pass own and pass event through |
26 // platform independent code. | 28 // platform independent code. |
27 struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { | 29 struct CONTENT_EXPORT NativeWebKeyboardEvent : |
| 30 NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { |
28 NativeWebKeyboardEvent(); | 31 NativeWebKeyboardEvent(); |
29 | 32 |
30 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
31 NativeWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); | 34 NativeWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); |
32 #elif defined(OS_MACOSX) | 35 #elif defined(OS_MACOSX) |
33 explicit NativeWebKeyboardEvent(NSEvent *event); | 36 explicit NativeWebKeyboardEvent(NSEvent *event); |
34 NativeWebKeyboardEvent(wchar_t character, | 37 NativeWebKeyboardEvent(wchar_t character, |
35 int state, | 38 int state, |
36 double time_stamp_seconds); | 39 double time_stamp_seconds); |
37 #elif defined(TOOLKIT_USES_GTK) | 40 #elif defined(TOOLKIT_USES_GTK) |
(...skipping 29 matching lines...) Expand all Loading... |
67 | 70 |
68 #if defined(TOOLKIT_USES_GTK) | 71 #if defined(TOOLKIT_USES_GTK) |
69 // True if the key event matches an edit command. In order to ensure the edit | 72 // True if the key event matches an edit command. In order to ensure the edit |
70 // command always work in web page, the browser should not pre-handle this key | 73 // command always work in web page, the browser should not pre-handle this key |
71 // event as a reserved accelerator. See http://crbug.com/54573 | 74 // event as a reserved accelerator. See http://crbug.com/54573 |
72 bool match_edit_command; | 75 bool match_edit_command; |
73 #endif | 76 #endif |
74 }; | 77 }; |
75 | 78 |
76 #endif // CONTENT_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ | 79 #endif // CONTENT_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ |
OLD | NEW |