Chromium Code Reviews| Index: chrome/common/native_web_keyboard_event_mac.mm |
| 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 0000000000000000000000000000000000000000..c1aa8b6142a6ee4307ce0104c7e1f64fba7af5c7 |
| --- /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() |
| + : event(NULL) { |
| +} |
| + |
| +NativeWebKeyboardEvent::NativeWebKeyboardEvent(NSEvent* event) |
| + : WebKeyboardEvent(event), |
| + event([event retain]) { |
|
Avi (use Gerrit)
2009/03/06 18:01:34
Not that it matters, but the semantics for gtk and
Elliot Glaysher
2009/03/06 20:51:25
Yeah. There's no refcounting on GdkEvents (since t
|
| +} |
| + |
| +NativeWebKeyboardEvent::NativeWebKeyboardEvent( |
| + const NativeWebKeyboardEvent& other) |
| + : WebKeyboardEvent(other), |
| + event([other.event retain]) { |
| +} |
| + |
| +NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( |
| + const NativeWebKeyboardEvent& other) { |
| + WebKeyboardEvent::operator=(other); |
| + |
| + NSObject* previous = event; |
| + event = [other.event retain]; |
| + [previous release]; |
| + |
| + return *this; |
| +} |
| + |
| +NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { |
| + [event release]; |
| +} |