Chromium Code Reviews| Index: chrome/browser/engagement/site_engagement_service.h |
| diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h |
| index 4cfdc78a6f7d6891be8c25f2a1993f5be06fe73c..6e98186b21f561f644037dbecdbc91f636a8d68b 100644 |
| --- a/chrome/browser/engagement/site_engagement_service.h |
| +++ b/chrome/browser/engagement/site_engagement_service.h |
| @@ -22,6 +22,10 @@ class DictionaryValue; |
| class Clock; |
| } |
| +namespace history { |
| +class HistoryService; |
| +} |
| + |
| class GURL; |
| class Profile; |
| @@ -101,8 +105,16 @@ class SiteEngagementScore { |
| double Score() const; |
| void AddPoints(double points); |
| - // Resets the score to |points| and reset the daily point limit. |
| - void Reset(double points); |
| + // Resets the score to |points| and resets the daily point limit. If |
| + // |updated_time| is non-null, sets the last engagement time and last |
| + // shortcut launch time (if it is non-null) to |updated_time|. Othewise, last |
|
benwells
2016/04/18 07:01:42
Typo in Othewise.
dominickn
2016/04/18 23:27:52
Done.
|
| + // engagement time is set to the current time and last shortcut launch time is |
| + // left unchanged. |
| + // TODO(calamity): Ideally, all SiteEngagementScore methods should take a |
|
benwells
2016/04/18 07:01:42
Could you file a bug and refer to it here?
dominickn
2016/04/18 23:27:52
Done.
|
| + // base::Time argument like this one does rather than each Score hold a |
| + // pointer to a base::Clock. Then SiteEngagementScore doesn't need to worry |
| + // about clock vending - it's always told what time to use. |
| + void Reset(double points, const base::Time* updated_time); |
| // Returns true if the maximum number of points today has been added. |
| bool MaxPointsPerDayAdded() const; |
| @@ -299,10 +311,18 @@ class SiteEngagementService : public KeyedService, |
| int OriginsWithMaxEngagement(const std::map<GURL, double>& score_map) const; |
| void GetCountsForOriginsComplete( |
| + history::HistoryService* history_service, |
| const std::multiset<GURL>& deleted_url_origins, |
| bool expired, |
| const history::OriginCountMap& remaining_origin_counts); |
| + // Resets the engagement score for |url| to |score|, and sets the last |
| + // engagement time and last shortcut launch time (if it is non-null) to |
| + // |updated_time|. Clears daily limits. |
| + void ResetScoreAndAccessTimesForURL(const GURL& url, |
| + double score, |
| + const base::Time* updated_time); |
| + |
| Profile* profile_; |
| // The clock used to vend times. |