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

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

Issue 2289273002: Eraser tool type plumbing from ui/events to web events and PPAPI. (Closed)
Patch Set: cleanup 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
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 return blink::WebPointerProperties::PointerType::Pen;
41 case EventPointerType::POINTER_TYPE_ERASER: 42 case EventPointerType::POINTER_TYPE_ERASER:
42 return blink::WebPointerProperties::PointerType::Pen; 43 return blink::WebPointerProperties::PointerType::Eraser;
43 case EventPointerType::POINTER_TYPE_TOUCH: 44 case EventPointerType::POINTER_TYPE_TOUCH:
44 return blink::WebPointerProperties::PointerType::Touch; 45 return blink::WebPointerProperties::PointerType::Touch;
45 } 46 }
46 NOTREACHED() << "Unexpected EventPointerType"; 47 NOTREACHED() << "Unexpected EventPointerType";
47 return blink::WebPointerProperties::PointerType::Unknown; 48 return blink::WebPointerProperties::PointerType::Unknown;
48 } 49 }
49 50
50 // Creates a WebGestureEvent from a GestureEvent. Note that it does not 51 // Creates a WebGestureEvent from a GestureEvent. Note that it does not
51 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So 52 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So
52 // the caller must populate these fields. 53 // the caller must populate these fields.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); 455 webkit_event.tiltX = roundf(event.pointer_details().tilt_x);
455 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); 456 webkit_event.tiltY = roundf(event.pointer_details().tilt_y);
456 webkit_event.force = event.pointer_details().force; 457 webkit_event.force = event.pointer_details().force;
457 webkit_event.pointerType = 458 webkit_event.pointerType =
458 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); 459 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type);
459 460
460 return webkit_event; 461 return webkit_event;
461 } 462 }
462 463
463 } // namespace ui 464 } // namespace ui
OLDNEW
« third_party/WebKit/public/platform/WebInputEvent.h ('K') | « ui/events/blink/blink_event_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698