| 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 "content/browser/renderer_host/input/web_input_event_builders_mac.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 11 | 11 |
| 12 using blink::WebInputEventFactory; | |
| 13 | |
| 14 namespace content { | 12 namespace content { |
| 15 | 13 |
| 16 NativeWebKeyboardEvent::NativeWebKeyboardEvent() | 14 NativeWebKeyboardEvent::NativeWebKeyboardEvent() |
| 17 : os_event(NULL), | 15 : os_event(NULL), |
| 18 skip_in_browser(false) { | 16 skip_in_browser(false) { |
| 19 } | 17 } |
| 20 | 18 |
| 21 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) | 19 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) |
| 22 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)), | 20 : WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)), |
| 23 os_event([native_event retain]), | 21 os_event([native_event retain]), |
| 24 skip_in_browser(false) { | 22 skip_in_browser(false) {} |
| 25 } | |
| 26 | 23 |
| 27 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event) | 24 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event) |
| 28 : NativeWebKeyboardEvent(key_event.native_event()) { | 25 : NativeWebKeyboardEvent(key_event.native_event()) { |
| 29 } | 26 } |
| 30 | 27 |
| 31 NativeWebKeyboardEvent::NativeWebKeyboardEvent( | 28 NativeWebKeyboardEvent::NativeWebKeyboardEvent( |
| 32 const NativeWebKeyboardEvent& other) | 29 const NativeWebKeyboardEvent& other) |
| 33 : WebKeyboardEvent(other), | 30 : WebKeyboardEvent(other), |
| 34 os_event([other.os_event retain]), | 31 os_event([other.os_event retain]), |
| 35 skip_in_browser(other.skip_in_browser) { | 32 skip_in_browser(other.skip_in_browser) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 46 skip_in_browser = other.skip_in_browser; | 43 skip_in_browser = other.skip_in_browser; |
| 47 | 44 |
| 48 return *this; | 45 return *this; |
| 49 } | 46 } |
| 50 | 47 |
| 51 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { | 48 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { |
| 52 [os_event release]; | 49 [os_event release]; |
| 53 } | 50 } |
| 54 | 51 |
| 55 } // namespace content | 52 } // namespace content |
| OLD | NEW |