| OLD | NEW |
| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 case blink::WebInputEvent::MouseDown: | 98 case blink::WebInputEvent::MouseDown: |
| 99 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_MOUSE); | 99 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_MOUSE); |
| 100 break; | 100 break; |
| 101 case blink::WebInputEvent::GestureTapDown: | 101 case blink::WebInputEvent::GestureTapDown: |
| 102 helper()->RecordUserInput( | 102 helper()->RecordUserInput( |
| 103 SiteEngagementMetrics::ENGAGEMENT_TOUCH_GESTURE); | 103 SiteEngagementMetrics::ENGAGEMENT_TOUCH_GESTURE); |
| 104 break; | 104 break; |
| 105 case blink::WebInputEvent::MouseWheel: | 105 case blink::WebInputEvent::MouseWheel: |
| 106 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_WHEEL); | 106 helper()->RecordUserInput(SiteEngagementMetrics::ENGAGEMENT_WHEEL); |
| 107 break; | 107 break; |
| 108 case blink::WebInputEvent::Undefined: |
| 109 // Explicitly ignore browser-initiated navigation input. |
| 110 break; |
| 108 default: | 111 default: |
| 109 NOTREACHED(); | 112 NOTREACHED(); |
| 110 } | 113 } |
| 111 Pause(); | 114 Pause(); |
| 112 } | 115 } |
| 113 | 116 |
| 114 SiteEngagementHelper::MediaTracker::MediaTracker( | 117 SiteEngagementHelper::MediaTracker::MediaTracker( |
| 115 SiteEngagementHelper* helper, | 118 SiteEngagementHelper* helper, |
| 116 content::WebContents* web_contents) | 119 content::WebContents* web_contents) |
| 117 : PeriodicTracker(helper), | 120 : PeriodicTracker(helper), |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 259 |
| 257 // static | 260 // static |
| 258 void SiteEngagementHelper::SetSecondsTrackingDelayAfterNavigation(int seconds) { | 261 void SiteEngagementHelper::SetSecondsTrackingDelayAfterNavigation(int seconds) { |
| 259 g_seconds_delay_after_navigation = seconds; | 262 g_seconds_delay_after_navigation = seconds; |
| 260 } | 263 } |
| 261 | 264 |
| 262 // static | 265 // static |
| 263 void SiteEngagementHelper::SetSecondsTrackingDelayAfterShow(int seconds) { | 266 void SiteEngagementHelper::SetSecondsTrackingDelayAfterShow(int seconds) { |
| 264 g_seconds_delay_after_show = seconds; | 267 g_seconds_delay_after_show = seconds; |
| 265 } | 268 } |
| OLD | NEW |