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

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

Issue 2235933002: Add POINTER_TYPE_ERASER to EventPointerType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 | « components/exo/wayland/server.cc ('k') | ui/events/event_constants.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 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 20 matching lines...) Expand all
31 } 31 }
32 32
33 blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType( 33 blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType(
34 EventPointerType pointer_type) { 34 EventPointerType pointer_type) {
35 switch (pointer_type) { 35 switch (pointer_type) {
36 case EventPointerType::POINTER_TYPE_UNKNOWN: 36 case EventPointerType::POINTER_TYPE_UNKNOWN:
37 return blink::WebPointerProperties::PointerType::Unknown; 37 return blink::WebPointerProperties::PointerType::Unknown;
38 case EventPointerType::POINTER_TYPE_MOUSE: 38 case EventPointerType::POINTER_TYPE_MOUSE:
39 return blink::WebPointerProperties::PointerType::Mouse; 39 return blink::WebPointerProperties::PointerType::Mouse;
40 case EventPointerType::POINTER_TYPE_PEN: 40 case EventPointerType::POINTER_TYPE_PEN:
41 case EventPointerType::POINTER_TYPE_ERASER:
41 return blink::WebPointerProperties::PointerType::Pen; 42 return blink::WebPointerProperties::PointerType::Pen;
42 case EventPointerType::POINTER_TYPE_TOUCH: 43 case EventPointerType::POINTER_TYPE_TOUCH:
43 return blink::WebPointerProperties::PointerType::Touch; 44 return blink::WebPointerProperties::PointerType::Touch;
44 } 45 }
45 NOTREACHED() << "Unexpected EventPointerType"; 46 NOTREACHED() << "Unexpected EventPointerType";
46 return blink::WebPointerProperties::PointerType::Unknown; 47 return blink::WebPointerProperties::PointerType::Unknown;
47 } 48 }
48 49
49 // Creates a WebGestureEvent from a GestureEvent. Note that it does not 50 // Creates a WebGestureEvent from a GestureEvent. Note that it does not
50 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So 51 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); 454 webkit_event.tiltX = roundf(event.pointer_details().tilt_x);
454 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); 455 webkit_event.tiltY = roundf(event.pointer_details().tilt_y);
455 webkit_event.force = event.pointer_details().force; 456 webkit_event.force = event.pointer_details().force;
456 webkit_event.pointerType = 457 webkit_event.pointerType =
457 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); 458 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type);
458 459
459 return webkit_event; 460 return webkit_event;
460 } 461 }
461 462
462 } // namespace ui 463 } // namespace ui
OLDNEW
« no previous file with comments | « components/exo/wayland/server.cc ('k') | ui/events/event_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698