Clean up check for dependency_info.
[chromium-blink-merge.git] / content / public / browser / native_web_keyboard_event.h
blob8c34c708694530c5cf325e2caf5ded1f07bc676d
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_
6 #define CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "build/build_config.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h"
13 #include "ui/events/event_constants.h"
14 #include "ui/gfx/native_widget_types.h"
16 namespace ui {
17 class KeyEvent;
20 namespace content {
22 // Owns a platform specific event; used to pass own and pass event through
23 // platform independent code.
24 struct CONTENT_EXPORT NativeWebKeyboardEvent :
25 NON_EXPORTED_BASE(public blink::WebKeyboardEvent) {
26 NativeWebKeyboardEvent();
28 explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event);
29 #if defined(OS_ANDROID)
30 NativeWebKeyboardEvent(blink::WebInputEvent::Type type,
31 int modifiers,
32 double time_secs,
33 int keycode,
34 int scancode,
35 int unicode_character,
36 bool is_system_key);
37 // Takes ownership of android_key_event.
38 NativeWebKeyboardEvent(jobject android_key_event,
39 blink::WebInputEvent::Type type,
40 int modifiers,
41 double time_secs,
42 int keycode,
43 int scancode,
44 int unicode_character,
45 bool is_system_key);
46 #else
47 explicit NativeWebKeyboardEvent(const ui::KeyEvent& key_event);
48 #if defined(USE_AURA)
49 NativeWebKeyboardEvent(ui::EventType type,
50 bool is_char,
51 wchar_t character,
52 int state,
53 double time_stamp_seconds);
54 #endif
55 #endif
57 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event);
58 ~NativeWebKeyboardEvent();
60 NativeWebKeyboardEvent& operator=(const NativeWebKeyboardEvent& event);
62 gfx::NativeEvent os_event;
64 // True if the browser should ignore this event if it's not handled by the
65 // renderer. This happens for RawKeyDown events that are created while IME is
66 // active and is necessary to prevent backspace from doing "history back" if
67 // it is hit in ime mode.
68 // Currently, it's only used by Linux and Mac ports.
69 bool skip_in_browser;
71 #if defined(USE_AURA)
72 // True if the key event matches an edit command. In order to ensure the edit
73 // command always work in web page, the browser should not pre-handle this key
74 // event as a reserved accelerator. See http://crbug.com/54573
75 bool match_edit_command;
76 #endif
79 } // namespace content
81 #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_