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

Side by Side Diff: ui/events/gestures/gesture_recognizer_impl.cc

Issue 680413006: Re-enable Eager Gesture Recognition on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jdduke's comments. Created 6 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
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 "ui/events/gestures/gesture_recognizer_impl.h" 5 #include "ui/events/gestures/gesture_recognizer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 GestureRecognizerImpl::ProcessTouchEventPostDispatch( 252 GestureRecognizerImpl::ProcessTouchEventPostDispatch(
253 const TouchEvent& event, 253 const TouchEvent& event,
254 ui::EventResult result, 254 ui::EventResult result,
255 GestureConsumer* consumer) { 255 GestureConsumer* consumer) {
256 GestureProviderAura* gesture_provider = 256 GestureProviderAura* gesture_provider =
257 GetGestureProviderForConsumer(consumer); 257 GetGestureProviderForConsumer(consumer);
258 gesture_provider->OnTouchEventAck(result != ER_UNHANDLED); 258 gesture_provider->OnTouchEventAck(result != ER_UNHANDLED);
259 return gesture_provider->GetAndResetPendingGestures(); 259 return gesture_provider->GetAndResetPendingGestures();
260 } 260 }
261 261
262 GestureRecognizer::Gestures* GestureRecognizerImpl::ProcessTouchEventOnAsyncAck(
263 const TouchEvent& event,
264 ui::EventResult result,
265 GestureConsumer* consumer) {
266 if (result & ui::ER_CONSUMED)
267 return NULL;
268 GestureProviderAura* gesture_provider =
269 GetGestureProviderForConsumer(consumer);
270 gesture_provider->OnTouchEventAck(result != ER_UNHANDLED);
271 return gesture_provider->GetAndResetPendingGestures();
272 }
273
274 bool GestureRecognizerImpl::CleanupStateForConsumer( 262 bool GestureRecognizerImpl::CleanupStateForConsumer(
275 GestureConsumer* consumer) { 263 GestureConsumer* consumer) {
276 bool state_cleaned_up = false; 264 bool state_cleaned_up = false;
277 265
278 if (consumer_gesture_provider_.count(consumer)) { 266 if (consumer_gesture_provider_.count(consumer)) {
279 state_cleaned_up = true; 267 state_cleaned_up = true;
280 delete consumer_gesture_provider_[consumer]; 268 delete consumer_gesture_provider_[consumer];
281 consumer_gesture_provider_.erase(consumer); 269 consumer_gesture_provider_.erase(consumer);
282 } 270 }
283 271
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 std::vector<GestureEventHelper*>::iterator it; 328 std::vector<GestureEventHelper*>::iterator it;
341 for (it = helpers.begin(); it != helpers.end(); ++it) 329 for (it = helpers.begin(); it != helpers.end(); ++it)
342 gesture_recognizer->AddGestureEventHelper(*it); 330 gesture_recognizer->AddGestureEventHelper(*it);
343 331
344 helpers.clear(); 332 helpers.clear();
345 g_gesture_recognizer_instance = 333 g_gesture_recognizer_instance =
346 static_cast<GestureRecognizerImpl*>(gesture_recognizer); 334 static_cast<GestureRecognizerImpl*>(gesture_recognizer);
347 } 335 }
348 336
349 } // namespace ui 337 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698