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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 16 matching lines...) Expand all
27 27
28 #include "core/dom/Element.h" 28 #include "core/dom/Element.h"
29 #include "wtf/text/AtomicString.h" 29 #include "wtf/text/AtomicString.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 GestureEvent* GestureEvent::create(AbstractView* view, 33 GestureEvent* GestureEvent::create(AbstractView* view,
34 const WebGestureEvent& event) { 34 const WebGestureEvent& event) {
35 AtomicString eventType; 35 AtomicString eventType;
36 36
37 switch (event.type) { 37 switch (event.type()) {
38 case WebInputEvent::GestureScrollBegin: 38 case WebInputEvent::GestureScrollBegin:
39 eventType = EventTypeNames::gesturescrollstart; 39 eventType = EventTypeNames::gesturescrollstart;
40 break; 40 break;
41 case WebInputEvent::GestureScrollEnd: 41 case WebInputEvent::GestureScrollEnd:
42 eventType = EventTypeNames::gesturescrollend; 42 eventType = EventTypeNames::gesturescrollend;
43 break; 43 break;
44 case WebInputEvent::GestureScrollUpdate: 44 case WebInputEvent::GestureScrollUpdate:
45 eventType = EventTypeNames::gesturescrollupdate; 45 eventType = EventTypeNames::gesturescrollupdate;
46 break; 46 break;
47 case WebInputEvent::GestureTap: 47 case WebInputEvent::GestureTap:
(...skipping 27 matching lines...) Expand all
75 75
76 GestureEvent::GestureEvent(const AtomicString& eventType, 76 GestureEvent::GestureEvent(const AtomicString& eventType,
77 AbstractView* view, 77 AbstractView* view,
78 const WebGestureEvent& event) 78 const WebGestureEvent& event)
79 : UIEventWithKeyState( 79 : UIEventWithKeyState(
80 eventType, 80 eventType,
81 true, 81 true,
82 true, 82 true,
83 view, 83 view,
84 0, 84 0,
85 static_cast<PlatformEvent::Modifiers>(event.modifiers), 85 static_cast<PlatformEvent::Modifiers>(event.modifiers()),
86 TimeTicks::FromSeconds(event.timeStampSeconds), 86 TimeTicks::FromSeconds(event.timeStampSeconds()),
87 nullptr), 87 nullptr),
88 m_nativeEvent(event) {} 88 m_nativeEvent(event) {}
89 89
90 const AtomicString& GestureEvent::interfaceName() const { 90 const AtomicString& GestureEvent::interfaceName() const {
91 // FIXME: when a GestureEvent.idl interface is defined, return the string 91 // FIXME: when a GestureEvent.idl interface is defined, return the string
92 // "GestureEvent". Until that happens, do not advertise an interface that 92 // "GestureEvent". Until that happens, do not advertise an interface that
93 // does not exist, since it will trip up the bindings integrity checks. 93 // does not exist, since it will trip up the bindings integrity checks.
94 return UIEvent::interfaceName(); 94 return UIEvent::interfaceName();
95 } 95 }
96 96
97 bool GestureEvent::isGestureEvent() const { 97 bool GestureEvent::isGestureEvent() const {
98 return true; 98 return true;
99 } 99 }
100 100
101 DEFINE_TRACE(GestureEvent) { 101 DEFINE_TRACE(GestureEvent) {
102 UIEvent::trace(visitor); 102 UIEvent::trace(visitor);
103 } 103 }
104 104
105 } // namespace blink 105 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp ('k') | third_party/WebKit/Source/core/events/KeyboardEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698