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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698