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

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

Issue 78263003: Ignore TouchCancel ack dispositions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REbase Created 7 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 #include "content/browser/renderer_host/input/synthetic_web_input_event_builders .h" 5 #include "content/browser/renderer_host/input/synthetic_web_input_event_builders .h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
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 #include "ui/events/keycodes/keyboard_codes.h" 9 #include "ui/events/keycodes/keyboard_codes.h"
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 touches[index].state = WebTouchPoint::StateMoved; 161 touches[index].state = WebTouchPoint::StateMoved;
162 type = WebInputEvent::TouchMove; 162 type = WebInputEvent::TouchMove;
163 } 163 }
164 164
165 void SyntheticWebTouchEvent::ReleasePoint(int index) { 165 void SyntheticWebTouchEvent::ReleasePoint(int index) {
166 CHECK(index >= 0 && index < touchesLengthCap); 166 CHECK(index >= 0 && index < touchesLengthCap);
167 touches[index].state = WebTouchPoint::StateReleased; 167 touches[index].state = WebTouchPoint::StateReleased;
168 type = WebInputEvent::TouchEnd; 168 type = WebInputEvent::TouchEnd;
169 } 169 }
170 170
171 void SyntheticWebTouchEvent::CancelPoint(int index) {
172 CHECK(index >= 0 && index < touchesLengthCap);
173 touches[index].state = WebTouchPoint::StateCancelled;
174 type = WebInputEvent::TouchCancel;
175 }
176
171 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { 177 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) {
172 timeStampSeconds = timestamp.InSecondsF(); 178 timeStampSeconds = timestamp.InSecondsF();
173 } 179 }
174 180
175 SyntheticWebTouchEvent SyntheticWebTouchEventBuilder::Build( 181 SyntheticWebTouchEvent SyntheticWebTouchEventBuilder::Build(
176 WebInputEvent::Type type) { 182 WebInputEvent::Type type) {
177 DCHECK(WebInputEvent::isTouchEventType(type)); 183 DCHECK(WebInputEvent::isTouchEventType(type));
178 SyntheticWebTouchEvent result; 184 SyntheticWebTouchEvent result;
179 result.type = type; 185 result.type = type;
180 return result; 186 return result;
181 }; 187 };
182 188
183 } // namespace content 189 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698