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
3 // found in the LICENSE file.
5 #include "content/public/browser/native_web_keyboard_event.h"
7 #import <AppKit/AppKit.h>
9 #include "third_party/WebKit/public/web/mac/WebInputEventFactory.h"
10 #include "ui/events/event.h"
12 using blink::WebInputEventFactory;
16 NativeWebKeyboardEvent::NativeWebKeyboardEvent()
18 skip_in_browser(false) {
21 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
22 : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)),
23 os_event([native_event retain]),
24 skip_in_browser(false) {
27 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event)
28 : NativeWebKeyboardEvent(key_event.native_event()) {
31 NativeWebKeyboardEvent::NativeWebKeyboardEvent(
32 const NativeWebKeyboardEvent& other)
33 : WebKeyboardEvent(other),
34 os_event([other.os_event retain]),
35 skip_in_browser(other.skip_in_browser) {
38 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(
39 const NativeWebKeyboardEvent& other) {
40 WebKeyboardEvent::operator=(other);
42 NSObject* previous = os_event;
43 os_event = [other.os_event retain];
46 skip_in_browser = other.skip_in_browser;
51 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
55 } // namespace content