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

Side by Side Diff: chrome/browser/engagement/site_engagement_helper.cc

Issue 2411143003: Make WebContentsObserver::DidGetUserInteraction fire on TouchStart instead of GestureTapBegin. (Closed)
Patch Set: Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/engagement/site_engagement_helper.h" 5 #include "chrome/browser/engagement/site_engagement_helper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // This switch has a default NOTREACHED case because it will not test all 93 // This switch has a default NOTREACHED case because it will not test all
94 // of the values of the WebInputEvent::Type enum (hence it won't require the 94 // of the values of the WebInputEvent::Type enum (hence it won't require the
95 // compiler verifying that all cases are covered). 95 // compiler verifying that all cases are covered).
96 switch (type) { 96 switch (type) {
97 case blink::WebInputEvent::RawKeyDown: 97 case blink::WebInputEvent::RawKeyDown:
98 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_KEYPRESS); 98 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_KEYPRESS);
99 break; 99 break;
100 case blink::WebInputEvent::MouseDown: 100 case blink::WebInputEvent::MouseDown:
101 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_MOUSE); 101 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_MOUSE);
102 break; 102 break;
103 case blink::WebInputEvent::GestureTapDown: 103 case blink::WebInputEvent::TouchStart:
104 helper()->RecordUserInput( 104 helper()->RecordUserInput(
105 SiteEngagementMetrics::ENGAGEMENT_TOUCH_GESTURE); 105 SiteEngagementMetrics::ENGAGEMENT_TOUCH_GESTURE);
106 break; 106 break;
107 case blink::WebInputEvent::GestureScrollBegin: 107 case blink::WebInputEvent::GestureScrollBegin:
108 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_SCROLL); 108 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_SCROLL);
109 break; 109 break;
110 case blink::WebInputEvent::Undefined: 110 case blink::WebInputEvent::Undefined:
111 // Explicitly ignore browser-initiated navigation input. 111 // Explicitly ignore browser-initiated navigation input.
112 break; 112 break;
113 default: 113 default:
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 void SiteEngagementService::Helper::SetSecondsTrackingDelayAfterNavigation( 242 void SiteEngagementService::Helper::SetSecondsTrackingDelayAfterNavigation(
243 int seconds) { 243 int seconds) {
244 g_seconds_delay_after_navigation = seconds; 244 g_seconds_delay_after_navigation = seconds;
245 } 245 }
246 246
247 // static 247 // static
248 void SiteEngagementService::Helper::SetSecondsTrackingDelayAfterShow( 248 void SiteEngagementService::Helper::SetSecondsTrackingDelayAfterShow(
249 int seconds) { 249 int seconds) {
250 g_seconds_delay_after_show = seconds; 250 g_seconds_delay_after_show = seconds;
251 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698