| 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 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ |
| 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ | 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "chrome/browser/engagement/site_engagement_metrics.h" | 10 #include "chrome/browser/engagement/site_engagement_metrics.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class Origin; | 23 class Origin; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // Per-WebContents class to handle updating the site engagement scores for | 26 // Per-WebContents class to handle updating the site engagement scores for |
| 27 // origins. | 27 // origins. |
| 28 class SiteEngagementService::Helper | 28 class SiteEngagementService::Helper |
| 29 : public content::WebContentsObserver, | 29 : public content::WebContentsObserver, |
| 30 public content::WebContentsUserData<SiteEngagementService::Helper> { | 30 public content::WebContentsUserData<SiteEngagementService::Helper> { |
| 31 public: | 31 public: |
| 32 static void SetSecondsBetweenUserInputCheck(int seconds); | 32 static void SetSecondsBetweenUserInputCheck(int seconds); |
| 33 static void SetSecondsTrackingDelayAfterNavigation(int seconds); |
| 33 static void SetSecondsTrackingDelayAfterShow(int seconds); | 34 static void SetSecondsTrackingDelayAfterShow(int seconds); |
| 34 | 35 |
| 35 ~Helper() override; | 36 ~Helper() override; |
| 36 | 37 |
| 37 void OnEngagementLevelChanged(const GURL& url, | 38 void OnEngagementLevelChanged(const GURL& url, |
| 38 blink::mojom::EngagementLevel level); | 39 blink::mojom::EngagementLevel level); |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 // Class to encapsulate the periodic detection of site engagement. | 42 // Class to encapsulate the periodic detection of site engagement. |
| 42 // | 43 // |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void WasHidden() override; | 184 void WasHidden() override; |
| 184 | 185 |
| 185 InputTracker input_tracker_; | 186 InputTracker input_tracker_; |
| 186 MediaTracker media_tracker_; | 187 MediaTracker media_tracker_; |
| 187 SiteEngagementService* service_; | 188 SiteEngagementService* service_; |
| 188 | 189 |
| 189 DISALLOW_COPY_AND_ASSIGN(Helper); | 190 DISALLOW_COPY_AND_ASSIGN(Helper); |
| 190 }; | 191 }; |
| 191 | 192 |
| 192 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ | 193 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ |
| OLD | NEW |