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