Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4594)

Unified Diff: chrome/common/native_web_keyboard_event_mac.mm

Issue 40065: RenderWidgetHost now stores both the WebKeyboardEvent and the native (Closed)
Patch Set: Redesign Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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];
+}

Powered by Google App Engine
This is Rietveld 408576698