OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/renderer_host/input/motion_event_web.h" | 5 #include "content/browser/renderer_host/input/motion_event_web.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/input/web_touch_event_traits.h" | 8 #include "content/common/input/web_touch_event_traits.h" |
9 | 9 |
10 using blink::WebInputEvent; | 10 using blink::WebInputEvent; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 float MotionEventWeb::GetPressure(size_t pointer_index) const { | 110 float MotionEventWeb::GetPressure(size_t pointer_index) const { |
111 return 0.f; | 111 return 0.f; |
112 } | 112 } |
113 | 113 |
114 base::TimeTicks MotionEventWeb::GetEventTime() const { | 114 base::TimeTicks MotionEventWeb::GetEventTime() const { |
115 return base::TimeTicks() + | 115 return base::TimeTicks() + |
116 base::TimeDelta::FromMicroseconds(event_.timeStampSeconds * | 116 base::TimeDelta::FromMicroseconds(event_.timeStampSeconds * |
117 base::Time::kMicrosecondsPerSecond); | 117 base::Time::kMicrosecondsPerSecond); |
118 } | 118 } |
119 | 119 |
120 size_t MotionEventWeb::GetHistorySize() const { return 0; } | |
121 | |
122 base::TimeTicks MotionEventWeb::GetHistoricalEventTime( | |
123 size_t historical_index) const { | |
124 NOTIMPLEMENTED(); | |
125 return base::TimeTicks(); | |
126 } | |
127 | |
128 float MotionEventWeb::GetHistoricalTouchMajor(size_t pointer_index, | |
129 size_t historical_index) const { | |
130 NOTIMPLEMENTED(); | |
131 return 0.f; | |
132 } | |
133 | |
134 float MotionEventWeb::GetHistoricalX(size_t pointer_index, | |
135 size_t historical_index) const { | |
136 NOTIMPLEMENTED(); | |
137 return 0.f; | |
138 } | |
139 | |
140 float MotionEventWeb::GetHistoricalY(size_t pointer_index, | |
141 size_t historical_index) const { | |
142 NOTIMPLEMENTED(); | |
143 return 0.f; | |
144 } | |
145 | |
146 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( | 120 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( |
147 size_t pointer_index) const { | 121 size_t pointer_index) const { |
148 NOTIMPLEMENTED(); | 122 NOTIMPLEMENTED(); |
149 return TOOL_TYPE_UNKNOWN; | 123 return TOOL_TYPE_UNKNOWN; |
150 } | 124 } |
151 | 125 |
152 int MotionEventWeb::GetButtonState() const { | 126 int MotionEventWeb::GetButtonState() const { |
153 NOTIMPLEMENTED(); | 127 NOTIMPLEMENTED(); |
154 return 0; | 128 return 0; |
155 } | 129 } |
156 | 130 |
157 scoped_ptr<ui::MotionEvent> MotionEventWeb::Clone() const { | 131 scoped_ptr<ui::MotionEvent> MotionEventWeb::Clone() const { |
158 return scoped_ptr<MotionEvent>(new MotionEventWeb(event_)); | 132 return scoped_ptr<MotionEvent>(new MotionEventWeb(event_)); |
159 } | 133 } |
160 | 134 |
161 scoped_ptr<ui::MotionEvent> MotionEventWeb::Cancel() const { | 135 scoped_ptr<ui::MotionEvent> MotionEventWeb::Cancel() const { |
162 WebTouchEvent cancel_event(event_); | 136 WebTouchEvent cancel_event(event_); |
163 WebTouchEventTraits::ResetTypeAndTouchStates( | 137 WebTouchEventTraits::ResetTypeAndTouchStates( |
164 blink::WebInputEvent::TouchCancel, | 138 blink::WebInputEvent::TouchCancel, |
165 // TODO(rbyers): Shouldn't we use a fresh timestamp? | 139 // TODO(rbyers): Shouldn't we use a fresh timestamp? |
166 event_.timeStampSeconds, | 140 event_.timeStampSeconds, |
167 &cancel_event); | 141 &cancel_event); |
168 return scoped_ptr<MotionEvent>(new MotionEventWeb(cancel_event)); | 142 return scoped_ptr<MotionEvent>(new MotionEventWeb(cancel_event)); |
169 } | 143 } |
170 | 144 |
171 } // namespace content | 145 } // namespace content |
OLD | NEW |