| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // engaged with an origin - the higher it is, the more engagement the user has | 116 // engaged with an origin - the higher it is, the more engagement the user has |
| 117 // had with this site recently. | 117 // had with this site recently. |
| 118 // | 118 // |
| 119 // Positive user activity, such as visiting the origin often and adding it to | 119 // Positive user activity, such as visiting the origin often and adding it to |
| 120 // the homescreen, will increase the site engagement score. Negative activity, | 120 // the homescreen, will increase the site engagement score. Negative activity, |
| 121 // such as rejecting permission prompts or not responding to notifications, will | 121 // such as rejecting permission prompts or not responding to notifications, will |
| 122 // decrease the site engagement score. | 122 // decrease the site engagement score. |
| 123 class SiteEngagementService : public KeyedService, | 123 class SiteEngagementService : public KeyedService, |
| 124 public SiteEngagementScoreProvider { | 124 public SiteEngagementScoreProvider { |
| 125 public: | 125 public: |
| 126 // The name of the site engagement variation field trial. |
| 127 static const char kEngagementParams[]; |
| 128 |
| 126 static SiteEngagementService* Get(Profile* profile); | 129 static SiteEngagementService* Get(Profile* profile); |
| 127 | 130 |
| 128 // Returns whether or not the SiteEngagementService is enabled. | 131 // Returns whether or not the SiteEngagementService is enabled. |
| 129 static bool IsEnabled(); | 132 static bool IsEnabled(); |
| 130 | 133 |
| 131 // Clears engagement scores for the given origins. | 134 // Clears engagement scores for the given origins. |
| 132 static void ClearHistoryForURLs(Profile* profile, | 135 static void ClearHistoryForURLs(Profile* profile, |
| 133 const std::set<GURL>& origins); | 136 const std::set<GURL>& origins); |
| 134 | 137 |
| 135 explicit SiteEngagementService(Profile* profile); | 138 explicit SiteEngagementService(Profile* profile); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // origin's engagement score after an hour has elapsed triggers the next | 193 // origin's engagement score after an hour has elapsed triggers the next |
| 191 // upload. | 194 // upload. |
| 192 base::Time last_metrics_time_; | 195 base::Time last_metrics_time_; |
| 193 | 196 |
| 194 base::WeakPtrFactory<SiteEngagementService> weak_factory_; | 197 base::WeakPtrFactory<SiteEngagementService> weak_factory_; |
| 195 | 198 |
| 196 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); | 199 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); |
| 197 }; | 200 }; |
| 198 | 201 |
| 199 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ | 202 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ |
| OLD | NEW |