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 #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/base/events.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 | 16 |
| 17 namespace content { |
| 18 |
17 // Owns a platform specific event; used to pass own and pass event through | 19 // Owns a platform specific event; used to pass own and pass event through |
18 // platform independent code. | 20 // platform independent code. |
19 struct CONTENT_EXPORT NativeWebKeyboardEvent : | 21 struct CONTENT_EXPORT NativeWebKeyboardEvent : |
20 NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { | 22 NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { |
21 NativeWebKeyboardEvent(); | 23 NativeWebKeyboardEvent(); |
22 | 24 |
23 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); | 25 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); |
24 #if defined(USE_AURA) | 26 #if defined(USE_AURA) |
25 NativeWebKeyboardEvent(ui::EventType type, | 27 NativeWebKeyboardEvent(ui::EventType type, |
26 bool is_char, | 28 bool is_char, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool skip_in_browser; | 69 bool skip_in_browser; |
68 | 70 |
69 #if defined(TOOLKIT_GTK) | 71 #if defined(TOOLKIT_GTK) |
70 // 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 |
71 // 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 |
72 // event as a reserved accelerator. See http://crbug.com/54573 | 74 // event as a reserved accelerator. See http://crbug.com/54573 |
73 bool match_edit_command; | 75 bool match_edit_command; |
74 #endif | 76 #endif |
75 }; | 77 }; |
76 | 78 |
77 namespace content { | |
78 | |
79 // Returns a bitmak of values from ui/base/events.h. | 79 // Returns a bitmak of values from ui/base/events.h. |
80 CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( | 80 CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( |
81 const NativeWebKeyboardEvent& event); | 81 const NativeWebKeyboardEvent& event); |
82 | 82 |
83 } // namespace content | 83 } // namespace content |
84 | 84 |
85 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 85 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
OLD | NEW |