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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "content/browser/renderer_host/input/motion_event_web.h" | 8 #include "content/browser/renderer_host/input/motion_event_web.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 | 149 |
150 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( | 150 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( |
151 size_t pointer_index) const { | 151 size_t pointer_index) const { |
152 // TODO(jdduke): Plumb tool type from the platform event, crbug.com/404128. | 152 // TODO(jdduke): Plumb tool type from the platform event, crbug.com/404128. |
153 DCHECK_LT(pointer_index, GetPointerCount()); | 153 DCHECK_LT(pointer_index, GetPointerCount()); |
154 return TOOL_TYPE_UNKNOWN; | 154 return TOOL_TYPE_UNKNOWN; |
155 } | 155 } |
156 | 156 |
157 int MotionEventWeb::GetButtonState() const { | 157 int MotionEventWeb::GetButtonState() const { |
158 NOTIMPLEMENTED(); | |
159 return 0; | 158 return 0; |
160 } | 159 } |
161 | 160 |
162 int MotionEventWeb::GetFlags() const { | 161 int MotionEventWeb::GetFlags() const { |
163 return WebEventModifiersToEventFlags(event_.modifiers); | 162 return WebEventModifiersToEventFlags(event_.modifiers); |
164 } | 163 } |
165 | 164 |
166 scoped_ptr<ui::MotionEvent> MotionEventWeb::Clone() const { | |
167 return scoped_ptr<MotionEvent>(new MotionEventWeb(event_)); | |
168 } | |
169 | |
170 scoped_ptr<ui::MotionEvent> MotionEventWeb::Cancel() const { | |
171 WebTouchEvent cancel_event(event_); | |
172 WebTouchEventTraits::ResetTypeAndTouchStates( | |
173 blink::WebInputEvent::TouchCancel, | |
174 // TODO(rbyers): Shouldn't we use a fresh timestamp? | |
175 event_.timeStampSeconds, | |
176 &cancel_event); | |
177 return scoped_ptr<MotionEvent>(new MotionEventWeb(cancel_event)); | |
178 } | |
179 | |
180 } // namespace content | 165 } // namespace content |
OLD | NEW |