Chromium Code Reviews| 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 ui { | |
| 17 class KeyEvent; | |
| 18 } | |
| 19 | |
| 16 namespace content { | 20 namespace content { |
| 17 | 21 |
| 18 // Owns a platform specific event; used to pass own and pass event through | 22 // Owns a platform specific event; used to pass own and pass event through |
| 19 // platform independent code. | 23 // platform independent code. |
| 20 struct CONTENT_EXPORT NativeWebKeyboardEvent : | 24 struct CONTENT_EXPORT NativeWebKeyboardEvent : |
| 21 NON_EXPORTED_BASE(public blink::WebKeyboardEvent) { | 25 NON_EXPORTED_BASE(public blink::WebKeyboardEvent) { |
| 22 NativeWebKeyboardEvent(); | 26 NativeWebKeyboardEvent(); |
| 23 | 27 |
| 24 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); | 28 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); |
| 29 explicit NativeWebKeyboardEvent(const ui::KeyEvent& key_event); | |
|
sadrul
2014/11/21 19:33:42
Should this have some sort of #ifdef guard? (I don
Andre
2014/11/22 00:09:58
Done.
Now guarded inside !ANDROID.
And looks like
| |
| 25 #if defined(USE_AURA) | 30 #if defined(USE_AURA) |
| 26 NativeWebKeyboardEvent(ui::EventType type, | 31 NativeWebKeyboardEvent(ui::EventType type, |
| 27 bool is_char, | 32 bool is_char, |
| 28 wchar_t character, | 33 wchar_t character, |
| 29 int state, | 34 int state, |
| 30 double time_stamp_seconds); | 35 double time_stamp_seconds); |
| 31 #elif defined(OS_MACOSX) | 36 #elif defined(OS_MACOSX) |
| 32 // TODO(suzhe): Limit these constructors to Linux native Gtk port. | 37 // TODO(suzhe): Limit these constructors to Linux native Gtk port. |
| 33 // For Linux Views port, after using RenderWidgetHostViewViews to replace | 38 // For Linux Views port, after using RenderWidgetHostViewViews to replace |
| 34 // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined | 39 // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 #endif | 80 #endif |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 // Returns a bitmak of values from ui/events/event_constants.h. | 83 // Returns a bitmak of values from ui/events/event_constants.h. |
| 79 CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( | 84 CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( |
| 80 const NativeWebKeyboardEvent& event); | 85 const NativeWebKeyboardEvent& event); |
| 81 | 86 |
| 82 } // namespace content | 87 } // namespace content |
| 83 | 88 |
| 84 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ | 89 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| OLD | NEW |