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

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

Issue 999423003: Set the unique_event_id when converting from TouchEvent to WebTouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 // 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return i; 56 return i;
57 } 57 }
58 return -1; 58 return -1;
59 } 59 }
60 60
61 } // namespace 61 } // namespace
62 62
63 MotionEventWeb::MotionEventWeb(const WebTouchEvent& event) 63 MotionEventWeb::MotionEventWeb(const WebTouchEvent& event)
64 : event_(event), 64 : event_(event),
65 cached_action_(GetActionFrom(event)), 65 cached_action_(GetActionFrom(event)),
66 cached_action_index_(GetActionIndexFrom(event)) { 66 cached_action_index_(GetActionIndexFrom(event)),
67 unique_event_id_(event.uniqueTouchEventId) {
67 DCHECK_GT(GetPointerCount(), 0U); 68 DCHECK_GT(GetPointerCount(), 0U);
68 } 69 }
69 70
70 MotionEventWeb::~MotionEventWeb() {} 71 MotionEventWeb::~MotionEventWeb() {}
71 72
72 int MotionEventWeb::GetId() const { 73 uint32 MotionEventWeb::GetUniqueEventId() const {
73 return 0; 74 return unique_event_id_;
74 } 75 }
75 76
76 MotionEventWeb::Action MotionEventWeb::GetAction() const { 77 MotionEventWeb::Action MotionEventWeb::GetAction() const {
77 return cached_action_; 78 return cached_action_;
78 } 79 }
79 80
80 int MotionEventWeb::GetActionIndex() const { 81 int MotionEventWeb::GetActionIndex() const {
81 DCHECK(cached_action_ == ACTION_POINTER_UP || 82 DCHECK(cached_action_ == ACTION_POINTER_UP ||
82 cached_action_ == ACTION_POINTER_DOWN) 83 cached_action_ == ACTION_POINTER_DOWN)
83 << "Invalid action for GetActionIndex(): " << cached_action_; 84 << "Invalid action for GetActionIndex(): " << cached_action_;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 164
164 int MotionEventWeb::GetButtonState() const { 165 int MotionEventWeb::GetButtonState() const {
165 return 0; 166 return 0;
166 } 167 }
167 168
168 int MotionEventWeb::GetFlags() const { 169 int MotionEventWeb::GetFlags() const {
169 return WebEventModifiersToEventFlags(event_.modifiers); 170 return WebEventModifiersToEventFlags(event_.modifiers);
170 } 171 }
171 172
172 } // namespace content 173 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/motion_event_web.h ('k') | content/browser/renderer_host/input/touch_emulator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698