diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:50:52 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:50:52 +0000 |
commit | d74cec8902c565f0045d2747a7091f4d2931f57b (patch) | |
tree | 0b62b664e5720e52b7680ac4411813d11b7f45aa /chrome/common/native_web_keyboard_event_mac.mm | |
parent | 1040cb10711a7a19051576eb96f33fc3632088f3 (diff) | |
download | chromium_src-d74cec8902c565f0045d2747a7091f4d2931f57b.zip chromium_src-d74cec8902c565f0045d2747a7091f4d2931f57b.tar.gz chromium_src-d74cec8902c565f0045d2747a7091f4d2931f57b.tar.bz2 |
RenderWidgetHost now only accepts a new NativeWebKeyboardEvent which owns a copy of the native os event.
Only the WebKeyboardEvent is sent over the IPC barrier, but the full structure passed to the unhandled key event handler.
BUG=4772
Review URL: http://codereview.chromium.org/40065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11152 0039d316-1c4b-4281-b951-d872f2087c98
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]; +} |