| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 base::TimeDelta delay) { | 61 base::TimeDelta delay) { |
| 62 pause_timer_->Start( | 62 pause_timer_->Start( |
| 63 FROM_HERE, delay, | 63 FROM_HERE, delay, |
| 64 base::Bind(&SiteEngagementHelper::PeriodicTracker::TrackingStarted, | 64 base::Bind(&SiteEngagementHelper::PeriodicTracker::TrackingStarted, |
| 65 base::Unretained(this))); | 65 base::Unretained(this))); |
| 66 } | 66 } |
| 67 | 67 |
| 68 SiteEngagementHelper::InputTracker::InputTracker( | 68 SiteEngagementHelper::InputTracker::InputTracker( |
| 69 SiteEngagementHelper* helper, | 69 SiteEngagementHelper* helper, |
| 70 content::WebContents* web_contents) | 70 content::WebContents* web_contents) |
| 71 : PeriodicTracker(helper), content::WebContentsObserver(web_contents) {} | 71 : PeriodicTracker(helper), |
| 72 content::WebContentsObserver(web_contents), |
| 73 is_tracking_(false) {} |
| 72 | 74 |
| 73 void SiteEngagementHelper::InputTracker::TrackingStarted() { | 75 void SiteEngagementHelper::InputTracker::TrackingStarted() { |
| 74 is_tracking_ = true; | 76 is_tracking_ = true; |
| 75 } | 77 } |
| 76 | 78 |
| 77 void SiteEngagementHelper::InputTracker::TrackingStopped() { | 79 void SiteEngagementHelper::InputTracker::TrackingStopped() { |
| 78 is_tracking_ = false; | 80 is_tracking_ = false; |
| 79 } | 81 } |
| 80 | 82 |
| 81 // Record that there was some user input, and defer handling of the input event. | 83 // Record that there was some user input, and defer handling of the input event. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 261 |
| 260 // static | 262 // static |
| 261 void SiteEngagementHelper::SetSecondsTrackingDelayAfterNavigation(int seconds) { | 263 void SiteEngagementHelper::SetSecondsTrackingDelayAfterNavigation(int seconds) { |
| 262 g_seconds_delay_after_navigation = seconds; | 264 g_seconds_delay_after_navigation = seconds; |
| 263 } | 265 } |
| 264 | 266 |
| 265 // static | 267 // static |
| 266 void SiteEngagementHelper::SetSecondsTrackingDelayAfterShow(int seconds) { | 268 void SiteEngagementHelper::SetSecondsTrackingDelayAfterShow(int seconds) { |
| 267 g_seconds_delay_after_show = seconds; | 269 g_seconds_delay_after_show = seconds; |
| 268 } | 270 } |
| OLD | NEW |