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

Side by Side Diff: content/browser/renderer_host/native_web_keyboard_event_mac.mm

Issue 2387353004: Delay Input.dispatchKeyEvent response until after key event ack. (Closed)
Patch Set: add test, address review comments about docs Created 4 years, 2 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/browser/native_web_keyboard_event.h" 5 #include "content/public/browser/native_web_keyboard_event.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h" 9 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 NativeWebKeyboardEvent::NativeWebKeyboardEvent() 14 NativeWebKeyboardEvent::NativeWebKeyboardEvent()
15 : os_event(NULL), 15 : os_event(NULL),
16 skip_in_browser(false) { 16 skip_in_browser(false),
17 is_synthetic(false) {
17 } 18 }
18 19
19 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) 20 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
20 : WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)), 21 : WebKeyboardEvent(WebKeyboardEventBuilder::Build(native_event)),
21 os_event([native_event retain]), 22 os_event([native_event retain]),
22 skip_in_browser(false) {} 23 skip_in_browser(false),
24 is_synthetic(false) {}
23 25
24 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event) 26 NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event)
25 : NativeWebKeyboardEvent(key_event.native_event()) { 27 : NativeWebKeyboardEvent(key_event.native_event()) {
26 } 28 }
27 29
28 NativeWebKeyboardEvent::NativeWebKeyboardEvent( 30 NativeWebKeyboardEvent::NativeWebKeyboardEvent(
29 const NativeWebKeyboardEvent& other) 31 const NativeWebKeyboardEvent& other)
30 : WebKeyboardEvent(other), 32 : WebKeyboardEvent(other),
31 os_event([other.os_event retain]), 33 os_event([other.os_event retain]),
32 skip_in_browser(other.skip_in_browser) { 34 skip_in_browser(other.skip_in_browser),
35 is_synthetic(false) {
33 } 36 }
34 37
35 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( 38 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(
36 const NativeWebKeyboardEvent& other) { 39 const NativeWebKeyboardEvent& other) {
37 WebKeyboardEvent::operator=(other); 40 WebKeyboardEvent::operator=(other);
38 41
39 NSObject* previous = os_event; 42 NSObject* previous = os_event;
40 os_event = [other.os_event retain]; 43 os_event = [other.os_event retain];
41 [previous release]; 44 [previous release];
42 45
43 skip_in_browser = other.skip_in_browser; 46 skip_in_browser = other.skip_in_browser;
47 is_synthetic = other.is_synthetic;
44 48
45 return *this; 49 return *this;
46 } 50 }
47 51
48 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() { 52 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
49 [os_event release]; 53 [os_event release];
50 } 54 }
51 55
52 } // namespace content 56 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698