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); | |
34 static void SetSecondsTrackingDelayAfterShow(int seconds); | 33 static void SetSecondsTrackingDelayAfterShow(int seconds); |
35 | 34 |
36 ~Helper() override; | 35 ~Helper() override; |
37 | 36 |
38 void OnEngagementLevelChanged(const GURL& url, | 37 void OnEngagementLevelChanged(const GURL& url, |
39 blink::mojom::EngagementLevel level); | 38 blink::mojom::EngagementLevel level); |
40 | 39 |
41 private: | 40 private: |
42 // Class to encapsulate the periodic detection of site engagement. | 41 // Class to encapsulate the periodic detection of site engagement. |
43 // | 42 // |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void WasHidden() override; | 183 void WasHidden() override; |
185 | 184 |
186 InputTracker input_tracker_; | 185 InputTracker input_tracker_; |
187 MediaTracker media_tracker_; | 186 MediaTracker media_tracker_; |
188 SiteEngagementService* service_; | 187 SiteEngagementService* service_; |
189 | 188 |
190 DISALLOW_COPY_AND_ASSIGN(Helper); | 189 DISALLOW_COPY_AND_ASSIGN(Helper); |
191 }; | 190 }; |
192 | 191 |
193 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ | 192 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_ |
OLD | NEW |