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 "content/browser/renderer_host/input/web_input_event_builders_mac.h"
10 #include "ui/events/event.h"
14 NativeWebKeyboardEvent::NativeWebKeyboardEvent()
16 skip_in_browser(false) {
19 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
20 : WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)),
21 os_event([native_event retain]),
22 skip_in_browser(false) {}
24 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event)
25 : NativeWebKeyboardEvent(key_event.native_event()) {
28 NativeWebKeyboardEvent::NativeWebKeyboardEvent(
29 const NativeWebKeyboardEvent& other)
30 : WebKeyboardEvent(other),
31 os_event([other.os_event retain]),
32 skip_in_browser(other.skip_in_browser) {
35 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(
36 const NativeWebKeyboardEvent& other) {
37 WebKeyboardEvent::operator=(other);
39 NSObject* previous = os_event;
40 os_event = [other.os_event retain];
43 skip_in_browser = other.skip_in_browser;
48 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
52 } // namespace content