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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_util.cc

Issue 510793003: Remove ui::TouchEvent -> blink::WebTouchEvent conversion methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/web_input_event_util.h" 8 #include "content/browser/renderer_host/input/web_input_event_util.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 WebTouchEventTraits::ResetType( 266 WebTouchEventTraits::ResetType(
267 ToWebInputEventType(event.GetAction()), 267 ToWebInputEventType(event.GetAction()),
268 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), 268 (event.GetEventTime() - base::TimeTicks()).InSecondsF(),
269 &result); 269 &result);
270 270
271 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); 271 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags());
272 result.touchesLength = 272 result.touchesLength =
273 std::min(event.GetPointerCount(), 273 std::min(event.GetPointerCount(),
274 static_cast<size_t>(WebTouchEvent::touchesLengthCap)); 274 static_cast<size_t>(WebTouchEvent::touchesLengthCap));
275 DCHECK_GT(result.touchesLength, 0U);
sadrul 2014/12/11 23:23:31 I suppose you are removing this because the tests
tdresser 2015/01/05 21:51:09 Correct.
276 275
277 for (size_t i = 0; i < result.touchesLength; ++i) 276 for (size_t i = 0; i < result.touchesLength; ++i)
278 result.touches[i] = CreateWebTouchPoint(event, i); 277 result.touches[i] = CreateWebTouchPoint(event, i);
279 278
280 return result; 279 return result;
281 } 280 }
282 281
283 WebGestureEvent CreateWebGestureEvent(const ui::GestureEventDetails& details, 282 WebGestureEvent CreateWebGestureEvent(const ui::GestureEventDetails& details,
284 base::TimeDelta timestamp, 283 base::TimeDelta timestamp,
285 const gfx::PointF& location, 284 const gfx::PointF& location,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 flags |= ui::EF_CAPS_LOCK_DOWN; 450 flags |= ui::EF_CAPS_LOCK_DOWN;
452 if (modifiers & blink::WebInputEvent::IsAutoRepeat) 451 if (modifiers & blink::WebInputEvent::IsAutoRepeat)
453 flags |= ui::EF_IS_REPEAT; 452 flags |= ui::EF_IS_REPEAT;
454 if (modifiers & blink::WebInputEvent::IsKeyPad) 453 if (modifiers & blink::WebInputEvent::IsKeyPad)
455 flags |= ui::EF_NUMPAD_KEY; 454 flags |= ui::EF_NUMPAD_KEY;
456 455
457 return flags; 456 return flags;
458 } 457 }
459 458
460 } // namespace content 459 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698