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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ |
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ | 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 explicit SiteEngagementService(Profile* profile); | 104 explicit SiteEngagementService(Profile* profile); |
105 ~SiteEngagementService() override; | 105 ~SiteEngagementService() override; |
106 | 106 |
107 // Update the karma score of the origin matching |url| for user navigation. | 107 // Update the karma score of the origin matching |url| for user navigation. |
108 void HandleNavigation(const GURL& url); | 108 void HandleNavigation(const GURL& url); |
109 | 109 |
110 // Returns a non-negative integer representing the engagement score of the | 110 // Returns a non-negative integer representing the engagement score of the |
111 // origin for this URL. | 111 // origin for this URL. |
112 int GetScore(const GURL& url); | 112 int GetScore(const GURL& url); |
113 | 113 |
| 114 // Returns the sum of engagement points awarded to all sites. |
| 115 int GetTotalEngagementPoints(); |
| 116 |
114 private: | 117 private: |
115 Profile* profile_; | 118 Profile* profile_; |
116 | 119 |
117 // The clock used to vend times. | 120 // The clock used to vend times. |
118 base::DefaultClock clock_; | 121 base::DefaultClock clock_; |
119 | 122 |
120 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); | 123 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); |
121 }; | 124 }; |
122 | 125 |
123 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ | 126 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ |
OLD | NEW |