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

Side by Side Diff: content/browser/renderer_host/gesture_event_filter.cc

Issue 10895024: Use new gesture event fields in more places (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CL diff to be against ToT (not one of my other branches) Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gesture_event_filter.h" 5 #include "content/browser/renderer_host/gesture_event_filter.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/browser/renderer_host/tap_suppression_controller.h" 10 #include "content/browser/renderer_host/tap_suppression_controller.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 } 164 }
165 165
166 void GestureEventFilter::MergeOrInsertScrollEvent( 166 void GestureEventFilter::MergeOrInsertScrollEvent(
167 const WebGestureEvent& gesture_event) { 167 const WebGestureEvent& gesture_event) {
168 WebGestureEvent* last_gesture_event = coalesced_gesture_events_.empty() ? 0 : 168 WebGestureEvent* last_gesture_event = coalesced_gesture_events_.empty() ? 0 :
169 &coalesced_gesture_events_.back(); 169 &coalesced_gesture_events_.back();
170 if (coalesced_gesture_events_.size() > 1 && 170 if (coalesced_gesture_events_.size() > 1 &&
171 last_gesture_event->type == gesture_event.type && 171 last_gesture_event->type == gesture_event.type &&
172 last_gesture_event->modifiers == gesture_event.modifiers) { 172 last_gesture_event->modifiers == gesture_event.modifiers) {
173 last_gesture_event->data.scrollUpdate.deltaX +=
174 gesture_event.data.scrollUpdate.deltaX;
175 last_gesture_event->data.scrollUpdate.deltaY +=
176 gesture_event.data.scrollUpdate.deltaY;
177 // TODO(rbyers): deltaX/deltaY fields going away. crbug.com/143237
173 last_gesture_event->deltaX += gesture_event.deltaX; 178 last_gesture_event->deltaX += gesture_event.deltaX;
174 last_gesture_event->deltaY += gesture_event.deltaY; 179 last_gesture_event->deltaY += gesture_event.deltaY;
175 DLOG_IF(WARNING, 180 DLOG_IF(WARNING,
176 gesture_event.timeStampSeconds <= 181 gesture_event.timeStampSeconds <=
177 last_gesture_event->timeStampSeconds) 182 last_gesture_event->timeStampSeconds)
178 << "Event time not monotonic?\n"; 183 << "Event time not monotonic?\n";
179 DCHECK(last_gesture_event->type == WebInputEvent::GestureScrollUpdate); 184 DCHECK(last_gesture_event->type == WebInputEvent::GestureScrollUpdate);
180 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds; 185 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds;
181 } else { 186 } else {
182 coalesced_gesture_events_.push_back(gesture_event); 187 coalesced_gesture_events_.push_back(gesture_event);
183 } 188 }
184 } 189 }
185 190
186 } // namespace content 191 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698