diff options
Diffstat (limited to 'chrome/common/native_web_keyboard_event_mac.mm')
-rw-r--r-- | chrome/common/native_web_keyboard_event_mac.mm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/common/native_web_keyboard_event_mac.mm b/chrome/common/native_web_keyboard_event_mac.mm new file mode 100644 index 0000000..4e1b9b5 --- /dev/null +++ b/chrome/common/native_web_keyboard_event_mac.mm @@ -0,0 +1,37 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/native_web_keyboard_event.h" + +#import <AppKit/AppKit.h> + +NativeWebKeyboardEvent::NativeWebKeyboardEvent() + : os_event(NULL) { +} + +NativeWebKeyboardEvent::NativeWebKeyboardEvent(NSEvent* event) + : WebKeyboardEvent(event), + os_event([event retain]) { +} + +NativeWebKeyboardEvent::NativeWebKeyboardEvent( + const NativeWebKeyboardEvent& other) + : WebKeyboardEvent(other), + os_event([other.os_event retain]) { +} + +NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( + const NativeWebKeyboardEvent& other) { + WebKeyboardEvent::operator=(other); + + NSObject* previous = os_event; + os_event = [other.os_event retain]; + [previous release]; + + return *this; +} + +NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { + [os_event release]; +} |