| 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" | |
| 11 #include "base/time/default_clock.h" | 10 #include "base/time/default_clock.h" |
| 12 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
| 14 | 13 |
| 15 namespace base { | 14 namespace base { |
| 16 class DictionaryValue; | 15 class DictionaryValue; |
| 17 } | 16 } |
| 18 | 17 |
| 19 class GURL; | 18 class GURL; |
| 20 class Profile; | 19 class Profile; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 static bool IsEnabled(); | 101 static bool IsEnabled(); |
| 103 | 102 |
| 104 explicit SiteEngagementService(Profile* profile); | 103 explicit SiteEngagementService(Profile* profile); |
| 105 ~SiteEngagementService() override; | 104 ~SiteEngagementService() override; |
| 106 | 105 |
| 107 // Update the karma score of the origin matching |url| for user navigation. | 106 // Update the karma score of the origin matching |url| for user navigation. |
| 108 void HandleNavigation(const GURL& url); | 107 void HandleNavigation(const GURL& url); |
| 109 | 108 |
| 110 // Returns a non-negative integer representing the engagement score of the | 109 // Returns a non-negative integer representing the engagement score of the |
| 111 // origin for this URL. | 110 // origin for this URL. |
| 112 int GetScore(const GURL& url); | 111 virtual int GetScore(const GURL& url); |
| 113 | 112 |
| 114 // Returns the sum of engagement points awarded to all sites. | 113 // Returns the sum of engagement points awarded to all sites. |
| 115 int GetTotalEngagementPoints(); | 114 virtual int GetTotalEngagementPoints(); |
| 116 | 115 |
| 117 private: | 116 private: |
| 118 Profile* profile_; | 117 Profile* profile_; |
| 119 | 118 |
| 120 // The clock used to vend times. | 119 // The clock used to vend times. |
| 121 base::DefaultClock clock_; | 120 base::DefaultClock clock_; |
| 122 | 121 |
| 123 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); | 122 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); |
| 124 }; | 123 }; |
| 125 | 124 |
| 126 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ | 125 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ |
| OLD | NEW |