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 #include "content/public/browser/native_web_keyboard_event.h" | 5 #include "content/public/browser/native_web_keyboard_event.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h" | 9 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h" |
| 10 #include "ui/events/base_event_utils.h" |
10 #include "ui/events/event.h" | 11 #include "ui/events/event.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 NativeWebKeyboardEvent::NativeWebKeyboardEvent() | 15 NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type, |
15 : os_event(NULL), | 16 int modifiers, |
16 skip_in_browser(false) { | 17 base::TimeTicks timestamp) |
17 } | 18 : NativeWebKeyboardEvent(type, |
| 19 modifiers, |
| 20 ui::EventTimeStampToSeconds(timestamp)) {} |
| 21 |
| 22 NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type, |
| 23 int modifiers, |
| 24 double timestampSeconds) |
| 25 : WebKeyboardEvent(type, modifiers, timestampSeconds), |
| 26 os_event(NULL), |
| 27 skip_in_browser(false) {} |
18 | 28 |
19 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) | 29 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) |
20 : WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)), | 30 : WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)), |
21 os_event([native_event retain]), | 31 os_event([native_event retain]), |
22 skip_in_browser(false) {} | 32 skip_in_browser(false) {} |
23 | 33 |
24 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event) | 34 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event) |
25 : NativeWebKeyboardEvent(key_event.native_event()) { | 35 : NativeWebKeyboardEvent(key_event.native_event()) { |
26 } | 36 } |
27 | 37 |
(...skipping 15 matching lines...) Expand all Loading... |
43 skip_in_browser = other.skip_in_browser; | 53 skip_in_browser = other.skip_in_browser; |
44 | 54 |
45 return *this; | 55 return *this; |
46 } | 56 } |
47 | 57 |
48 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { | 58 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { |
49 [os_event release]; | 59 [os_event release]; |
50 } | 60 } |
51 | 61 |
52 } // namespace content | 62 } // namespace content |
OLD | NEW |