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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 2289273002: Eraser tool type plumbing from ui/events to web events and PPAPI. (Closed)
Patch Set: add pen modifier and version uprev of ppapi 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 "core/events/PointerEventFactory.h" 5 #include "core/events/PointerEventFactory.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "platform/geometry/FloatSize.h" 8 #include "platform/geometry/FloatSize.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 namespace { 12 namespace {
13 13
14 inline int toInt(WebPointerProperties::PointerType t) { return static_cast<int>( t); } 14 inline int toInt(WebPointerProperties::PointerType t) { return static_cast<int>( t); }
15 15
16 const char* pointerTypeNameForWebPointPointerType(WebPointerProperties::PointerT ype type) 16 const char* pointerTypeNameForWebPointPointerType(WebPointerProperties::PointerT ype type)
17 { 17 {
18 switch (type) { 18 switch (type) {
19 case WebPointerProperties::PointerType::Unknown: 19 case WebPointerProperties::PointerType::Unknown:
20 return ""; 20 return "";
21 case WebPointerProperties::PointerType::Touch: 21 case WebPointerProperties::PointerType::Touch:
22 return "touch"; 22 return "touch";
23 case WebPointerProperties::PointerType::Pen: 23 case WebPointerProperties::PointerType::Pen:
24 case WebPointerProperties::PointerType::Eraser:
mustaq 2016/08/31 14:28:46 Please add a TODO referring to crbug.com/642455.
24 return "pen"; 25 return "pen";
25 case WebPointerProperties::PointerType::Mouse: 26 case WebPointerProperties::PointerType::Mouse:
26 return "mouse"; 27 return "mouse";
27 } 28 }
28 NOTREACHED(); 29 NOTREACHED();
29 return ""; 30 return "";
30 } 31 }
31 32
32 const AtomicString& pointerEventNameForMouseEventName( 33 const AtomicString& pointerEventNameForMouseEventName(
33 const AtomicString& mouseEventName) 34 const AtomicString& mouseEventName)
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if (properties.pointerType 395 if (properties.pointerType
395 == WebPointerProperties::PointerType::Mouse) 396 == WebPointerProperties::PointerType::Mouse)
396 return PointerEventFactory::s_mouseId; 397 return PointerEventFactory::s_mouseId;
397 IncomingId id(properties.pointerType, properties.id); 398 IncomingId id(properties.pointerType, properties.id);
398 if (m_pointerIncomingIdMapping.contains(id)) 399 if (m_pointerIncomingIdMapping.contains(id))
399 return m_pointerIncomingIdMapping.get(id); 400 return m_pointerIncomingIdMapping.get(id);
400 return PointerEventFactory::s_invalidId; 401 return PointerEventFactory::s_invalidId;
401 } 402 }
402 403
403 } // namespace blink 404 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698