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

Side by Side Diff: ui/events/gesture_detection/gesture_provider.cc

Issue 501553004: Move gesture/touch UMA logs into gesture provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add description to the comment Created 6 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
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 #include "ui/events/gesture_detection/gesture_provider.h" 5 #include "ui/events/gesture_detection/gesture_provider.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // It's possible that a double-tap drag zoom (from ScaleGestureDetector) 258 // It's possible that a double-tap drag zoom (from ScaleGestureDetector)
259 // will start before the press gesture fires (from GestureDetector), in 259 // will start before the press gesture fires (from GestureDetector), in
260 // which case the press should simply be dropped. 260 // which case the press should simply be dropped.
261 if (pinch_event_sent_ || scroll_event_sent_) 261 if (pinch_event_sent_ || scroll_event_sent_)
262 return; 262 return;
263 default: 263 default:
264 break; 264 break;
265 }; 265 };
266 266
267 client_->OnGestureEvent(gesture); 267 client_->OnGestureEvent(gesture);
268 GestureTouchUMAHistogram::RecordGestureEvent(gesture);
268 } 269 }
269 270
270 // ScaleGestureDetector::ScaleGestureListener implementation. 271 // ScaleGestureDetector::ScaleGestureListener implementation.
271 virtual bool OnScaleBegin(const ScaleGestureDetector& detector, 272 virtual bool OnScaleBegin(const ScaleGestureDetector& detector,
272 const MotionEvent& e) OVERRIDE { 273 const MotionEvent& e) OVERRIDE {
273 if (ignore_multitouch_zoom_events_ && !detector.InDoubleTapMode()) 274 if (ignore_multitouch_zoom_events_ && !detector.InDoubleTapMode())
274 return false; 275 return false;
275 return true; 276 return true;
276 } 277 }
277 278
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 GetMotionEventActionName(event.GetAction())); 650 GetMotionEventActionName(event.GetAction()));
650 651
651 DCHECK_NE(0u, event.GetPointerCount()); 652 DCHECK_NE(0u, event.GetPointerCount());
652 653
653 if (!CanHandle(event)) 654 if (!CanHandle(event))
654 return false; 655 return false;
655 656
656 OnTouchEventHandlingBegin(event); 657 OnTouchEventHandlingBegin(event);
657 gesture_listener_->OnTouchEvent(event); 658 gesture_listener_->OnTouchEvent(event);
658 OnTouchEventHandlingEnd(event); 659 OnTouchEventHandlingEnd(event);
660 uma_histogram_.RecordTouchEvent(event);
659 return true; 661 return true;
660 } 662 }
661 663
662 void GestureProvider::SetMultiTouchZoomSupportEnabled(bool enabled) { 664 void GestureProvider::SetMultiTouchZoomSupportEnabled(bool enabled) {
663 gesture_listener_->SetMultiTouchZoomEnabled(enabled); 665 gesture_listener_->SetMultiTouchZoomEnabled(enabled);
664 } 666 }
665 667
666 void GestureProvider::SetDoubleTapSupportForPlatformEnabled(bool enabled) { 668 void GestureProvider::SetDoubleTapSupportForPlatformEnabled(bool enabled) {
667 if (double_tap_support_for_platform_ == enabled) 669 if (double_tap_support_for_platform_ == enabled)
668 return; 670 return;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // null'ing of the listener until the sequence has ended. 758 // null'ing of the listener until the sequence has ended.
757 if (current_down_event_) 759 if (current_down_event_)
758 return; 760 return;
759 761
760 const bool double_tap_enabled = 762 const bool double_tap_enabled =
761 double_tap_support_for_page_ && double_tap_support_for_platform_; 763 double_tap_support_for_page_ && double_tap_support_for_platform_;
762 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); 764 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled);
763 } 765 }
764 766
765 } // namespace ui 767 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_provider.h ('k') | ui/events/gesture_detection/gesture_touch_uma_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698