| 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 "third_party/WebKit/public/web/mac/WebInputEventFactory.h" | 9 #include "third_party/WebKit/public/web/mac/WebInputEventFactory.h" |
| 10 #include "ui/events/event.h" |
| 10 | 11 |
| 11 using blink::WebInputEventFactory; | 12 using blink::WebInputEventFactory; |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 | 15 |
| 15 NativeWebKeyboardEvent::NativeWebKeyboardEvent() | 16 NativeWebKeyboardEvent::NativeWebKeyboardEvent() |
| 16 : os_event(NULL), | 17 : os_event(NULL), |
| 17 skip_in_browser(false) { | 18 skip_in_browser(false) { |
| 18 } | 19 } |
| 19 | 20 |
| 20 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) | 21 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) |
| 21 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)), | 22 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)), |
| 22 os_event([native_event retain]), | 23 os_event([native_event retain]), |
| 23 skip_in_browser(false) { | 24 skip_in_browser(false) { |
| 24 } | 25 } |
| 25 | 26 |
| 27 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event) |
| 28 : NativeWebKeyboardEvent(key_event.native_event()) { |
| 29 } |
| 30 |
| 26 NativeWebKeyboardEvent::NativeWebKeyboardEvent(wchar_t character, | 31 NativeWebKeyboardEvent::NativeWebKeyboardEvent(wchar_t character, |
| 27 int modifiers, | 32 int modifiers, |
| 28 double time_stamp_seconds) | 33 double time_stamp_seconds) |
| 29 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(character, | 34 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(character, |
| 30 modifiers, | 35 modifiers, |
| 31 time_stamp_seconds)), | 36 time_stamp_seconds)), |
| 32 os_event(NULL), | 37 os_event(NULL), |
| 33 skip_in_browser(false) { | 38 skip_in_browser(false) { |
| 34 } | 39 } |
| 35 | 40 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 51 skip_in_browser = other.skip_in_browser; | 56 skip_in_browser = other.skip_in_browser; |
| 52 | 57 |
| 53 return *this; | 58 return *this; |
| 54 } | 59 } |
| 55 | 60 |
| 56 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { | 61 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { |
| 57 [os_event release]; | 62 [os_event release]; |
| 58 } | 63 } |
| 59 | 64 |
| 60 } // namespace content | 65 } // namespace content |
| OLD | NEW |