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

Side by Side Diff: ui/events/blink/web_input_event.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/blink/web_input_event.h" 5 #include "ui/events/blink/web_input_event.h"
6 6
7 #include "ui/events/base_event_utils.h" 7 #include "ui/events/base_event_utils.h"
8 #include "ui/events/blink/blink_event_util.h" 8 #include "ui/events/blink/blink_event_util.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 break; 101 break;
102 default: 102 default:
103 NOTREACHED(); 103 NOTREACHED();
104 } 104 }
105 105
106 blink::WebKeyboardEvent webkit_event( 106 blink::WebKeyboardEvent webkit_event(
107 type, EventFlagsToWebEventModifiers(event.flags()) | 107 type, EventFlagsToWebEventModifiers(event.flags()) |
108 DomCodeToWebInputEventModifiers(event.code()), 108 DomCodeToWebInputEventModifiers(event.code()),
109 EventTimeStampToSeconds(event.time_stamp())); 109 EventTimeStampToSeconds(event.time_stamp()));
110 110
111 if (webkit_event.modifiers & blink::WebInputEvent::AltKey) 111 if (webkit_event.modifiers() & blink::WebInputEvent::AltKey)
112 webkit_event.isSystemKey = true; 112 webkit_event.isSystemKey = true;
113 113
114 // TODO(dtapuska): crbug.com/570388. Ozone appears to deliver 114 // TODO(dtapuska): crbug.com/570388. Ozone appears to deliver
115 // key_code events that aren't "located" for the keypad like 115 // key_code events that aren't "located" for the keypad like
116 // Windows and X11 do and blink expects. 116 // Windows and X11 do and blink expects.
117 webkit_event.windowsKeyCode = 117 webkit_event.windowsKeyCode =
118 NonLocatedToLocatedKeypadKeyboardCode(event.key_code(), event.code()); 118 NonLocatedToLocatedKeypadKeyboardCode(event.key_code(), event.code());
119 webkit_event.nativeKeyCode = 119 webkit_event.nativeKeyCode =
120 KeycodeConverter::DomCodeToNativeKeycode(event.code()); 120 KeycodeConverter::DomCodeToNativeKeycode(event.code());
121 webkit_event.domCode = static_cast<int>(event.code()); 121 webkit_event.domCode = static_cast<int>(event.code());
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); 449 webkit_event.tiltX = roundf(event.pointer_details().tilt_x);
450 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); 450 webkit_event.tiltY = roundf(event.pointer_details().tilt_y);
451 webkit_event.force = event.pointer_details().force; 451 webkit_event.force = event.pointer_details().force;
452 webkit_event.pointerType = 452 webkit_event.pointerType =
453 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); 453 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type);
454 454
455 return webkit_event; 455 return webkit_event;
456 } 456 }
457 457
458 } // namespace ui 458 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698