Chromium Code Reviews| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 rotation_angle_rad -= (float) M_PI_2; | 142 rotation_angle_rad -= (float) M_PI_2; |
| 143 } | 143 } |
| 144 | 144 |
| 145 return rotation_angle_rad; | 145 return rotation_angle_rad; |
| 146 } | 146 } |
| 147 | 147 |
| 148 float MotionEventWeb::GetPressure(size_t pointer_index) const { | 148 float MotionEventWeb::GetPressure(size_t pointer_index) const { |
| 149 return 0.f; | 149 return 0.f; |
| 150 } | 150 } |
| 151 | 151 |
| 152 float MotionEventWeb::GetTilt(size_t pointer_index) const { | |
| 153 return 0.f; | |
|
jdduke (slow)
2015/07/31 15:00:49
Hmm, can't we get this value from the WebTouchEven
USE eero AT chromium.org
2015/07/31 18:18:15
Yes, although it is a bit complex. Also this membe
| |
| 154 } | |
| 155 | |
| 152 base::TimeTicks MotionEventWeb::GetEventTime() const { | 156 base::TimeTicks MotionEventWeb::GetEventTime() const { |
| 153 return base::TimeTicks() + | 157 return base::TimeTicks() + |
| 154 base::TimeDelta::FromMicroseconds(event_.timeStampSeconds * | 158 base::TimeDelta::FromMicroseconds(event_.timeStampSeconds * |
| 155 base::Time::kMicrosecondsPerSecond); | 159 base::Time::kMicrosecondsPerSecond); |
| 156 } | 160 } |
| 157 | 161 |
| 158 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( | 162 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( |
| 159 size_t pointer_index) const { | 163 size_t pointer_index) const { |
| 160 // TODO(jdduke): Plumb tool type from the platform event, crbug.com/404128. | 164 // TODO(jdduke): Plumb tool type from the platform event, crbug.com/404128. |
| 161 DCHECK_LT(pointer_index, GetPointerCount()); | 165 DCHECK_LT(pointer_index, GetPointerCount()); |
| 162 return TOOL_TYPE_UNKNOWN; | 166 return TOOL_TYPE_UNKNOWN; |
| 163 } | 167 } |
| 164 | 168 |
| 165 int MotionEventWeb::GetButtonState() const { | 169 int MotionEventWeb::GetButtonState() const { |
| 166 return 0; | 170 return 0; |
| 167 } | 171 } |
| 168 | 172 |
| 169 int MotionEventWeb::GetFlags() const { | 173 int MotionEventWeb::GetFlags() const { |
| 170 return WebEventModifiersToEventFlags(event_.modifiers); | 174 return WebEventModifiersToEventFlags(event_.modifiers); |
| 171 } | 175 } |
| 172 | 176 |
| 173 } // namespace content | 177 } // namespace content |
| OLD | NEW |