Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2009 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. | |
| 4 | |
| 5 #include "chrome/common/native_web_keyboard_event.h" | |
| 6 | |
| 7 #import <AppKit/AppKit.h> | |
| 8 | |
| 9 NativeWebKeyboardEvent::NativeWebKeyboardEvent() | |
| 10 : event(NULL) { | |
| 11 } | |
| 12 | |
| 13 NativeWebKeyboardEvent::NativeWebKeyboardEvent(NSEvent* event) | |
| 14 : WebKeyboardEvent(event), | |
| 15 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
| |
| 16 } | |
| 17 | |
| 18 NativeWebKeyboardEvent::NativeWebKeyboardEvent( | |
| 19 const NativeWebKeyboardEvent& other) | |
| 20 : WebKeyboardEvent(other), | |
| 21 event([other.event retain]) { | |
| 22 } | |
| 23 | |
| 24 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( | |
| 25 const NativeWebKeyboardEvent& other) { | |
| 26 WebKeyboardEvent::operator=(other); | |
| 27 | |
| 28 NSObject* previous = event; | |
| 29 event = [other.event retain]; | |
| 30 [previous release]; | |
| 31 | |
| 32 return *this; | |
| 33 } | |
| 34 | |
| 35 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { | |
| 36 [event release]; | |
| 37 } | |
| OLD | NEW |