Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: chrome/browser/engagement/site_engagement_service.h

Issue 1919383005: Small cleanup of SiteEngagementService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit + rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 1d733322e887cced1264f0a6ac062984c06b8a99..31ead8b7945a327efa2289c2acd00b3de3f4b435 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -29,6 +29,7 @@ class HistoryService;
class GURL;
class Profile;
+class SiteEngagementScore;
class SiteEngagementScoreProvider {
public:
@@ -92,7 +93,7 @@ class SiteEngagementService : public KeyedService,
// Returns whether the engagement service has enough data to make meaningful
// decisions. Clients should avoid using engagement in their heuristic until
// this is true.
- bool IsBootstrapped();
+ bool IsBootstrapped() const;
// Returns whether |url| has at least the given |level| of engagement.
bool IsEngagementAtLeast(const GURL& url, EngagementLevel level) const;
@@ -130,6 +131,10 @@ class SiteEngagementService : public KeyedService,
// maximum limits for the day and overall.
void AddPoints(const GURL& url, double points);
+ // Retrieves the SiteEngagementScore object for |origin|.
+ SiteEngagementScore CreateEngagementScore(const GURL& origin);
+ const SiteEngagementScore CreateEngagementScore(const GURL& origin) const;
+
// Post startup tasks: cleaning up origins which have decayed to 0, and
// logging UMA statistics.
void AfterStartupTask();
@@ -167,17 +172,10 @@ class SiteEngagementService : public KeyedService,
// Callback for the history service when it is asked for a map of origins to
// how many URLs corresponding to that origin remain in history.
void GetCountsAndLastVisitForOriginsComplete(
- history::HistoryService* history_service,
- const std::multiset<GURL>& deleted_url_origins,
- bool expired,
- const history::OriginCountAndLastVisitMap& 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);
+ history::HistoryService* history_service,
+ const std::multiset<GURL>& deleted_url_origins,
+ bool expired,
+ const history::OriginCountAndLastVisitMap& remaining_origin_counts);
Profile* profile_;
« no previous file with comments | « chrome/browser/engagement/site_engagement_score_unittest.cc ('k') | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698