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

Side by Side Diff: ui/events/cocoa/events_mac.mm

Issue 1312833006: Remove ui::KeyEvent::platform_keycode_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 3 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
« no previous file with comments | « mojo/converters/input_events/input_events_type_converters.cc ('k') | ui/events/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/events/event_utils.h" 5 #include "ui/events/event_utils.h"
6 6
7 #include <Cocoa/Cocoa.h> 7 #include <Cocoa/Cocoa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 213 }
214 214
215 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { 215 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
216 return KeyboardCodeFromNSEvent(native_event); 216 return KeyboardCodeFromNSEvent(native_event);
217 } 217 }
218 218
219 DomCode CodeFromNative(const base::NativeEvent& native_event) { 219 DomCode CodeFromNative(const base::NativeEvent& native_event) {
220 return CodeFromNSEvent(native_event); 220 return CodeFromNSEvent(native_event);
221 } 221 }
222 222
223 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) {
224 return native_event.keyCode;
225 }
226
227 uint32 WindowsKeycodeFromNative(const base::NativeEvent& native_event) { 223 uint32 WindowsKeycodeFromNative(const base::NativeEvent& native_event) {
228 return static_cast<uint32>(KeyboardCodeFromNSEvent(native_event)); 224 return static_cast<uint32>(KeyboardCodeFromNSEvent(native_event));
229 } 225 }
230 226
231 uint16 TextFromNative(const base::NativeEvent& native_event) { 227 uint16 TextFromNative(const base::NativeEvent& native_event) {
232 NSString* text = @""; 228 NSString* text = @"";
233 if ([native_event type] != NSFlagsChanged) 229 if ([native_event type] != NSFlagsChanged)
234 text = [native_event characters]; 230 text = [native_event characters];
235 231
236 // These exceptions are based on WebInputEventFactoryMac.mm: 232 // These exceptions are based on WebInputEventFactoryMac.mm:
(...skipping 27 matching lines...) Expand all
264 uint16 return_value; 260 uint16 return_value;
265 [text getCharacters:&return_value]; 261 [text getCharacters:&return_value];
266 return return_value; 262 return return_value;
267 } 263 }
268 264
269 bool IsCharFromNative(const base::NativeEvent& native_event) { 265 bool IsCharFromNative(const base::NativeEvent& native_event) {
270 return false; 266 return false;
271 } 267 }
272 268
273 } // namespace ui 269 } // namespace ui
OLDNEW
« no previous file with comments | « mojo/converters/input_events/input_events_type_converters.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698