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

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

Issue 67383002: Initial browser-side implementation for touch-action (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks from sadrul/jdduke CR Created 7 years, 1 month 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 | Annotate | Revision Log
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/touch_event_queue.h" 5 #include "content/browser/renderer_host/input/touch_event_queue.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 } 195 }
196 196
197 void TouchEventQueue::FlushQueue() { 197 void TouchEventQueue::FlushQueue() {
198 DCHECK(!dispatching_touch_ack_); 198 DCHECK(!dispatching_touch_ack_);
199 while (!touch_queue_.empty()) 199 while (!touch_queue_.empty())
200 PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, 200 PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NOT_CONSUMED,
201 ui::LatencyInfo()); 201 ui::LatencyInfo());
202 } 202 }
203 203
204 bool TouchEventQueue::IsPendingAckTouchStart() const {
205 DCHECK(!dispatching_touch_ack_);
206 if (touch_queue_.empty())
207 return false;
208
209 const blink::WebTouchEvent& event =
210 touch_queue_.front()->coalesced_event().event;
211 return (event.type == blink::WebInputEvent::TouchStart);
212 }
213
204 size_t TouchEventQueue::GetQueueSize() const { 214 size_t TouchEventQueue::GetQueueSize() const {
205 return touch_queue_.size(); 215 return touch_queue_.size();
206 } 216 }
207 217
208 const TouchEventWithLatencyInfo& TouchEventQueue::GetLatestEvent() const { 218 const TouchEventWithLatencyInfo& TouchEventQueue::GetLatestEvent() const {
209 return touch_queue_.back()->coalesced_event(); 219 return touch_queue_.back()->coalesced_event();
210 } 220 }
211 221
212 void TouchEventQueue::PopTouchEventToClient( 222 void TouchEventQueue::PopTouchEventToClient(
213 InputEventAckState ack_result, 223 InputEventAckState ack_result,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // If the ACK status of a point is unknown, then the event should be 267 // If the ACK status of a point is unknown, then the event should be
258 // forwarded to the renderer. 268 // forwarded to the renderer.
259 return true; 269 return true;
260 } 270 }
261 } 271 }
262 272
263 return false; 273 return false;
264 } 274 }
265 275
266 } // namespace content 276 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698