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

Unified Diff: chrome/browser/engagement/important_sites_util.cc

Issue 2535483002: Plumb site engagement to the renderer process. (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/engagement/site_engagement_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/engagement/important_sites_util.cc
diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc
index e50ebc914073e6856fb7c5da127303d70bbf5b04..cdb5ff7dd5ccc1e2e88d5ec6cac644848c88a0d8 100644
--- a/chrome/browser/engagement/important_sites_util.cc
+++ b/chrome/browser/engagement/important_sites_util.cc
@@ -26,6 +26,7 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include "third_party/WebKit/public/platform/site_engagement.mojom.h"
#include "url/gurl.h"
namespace {
@@ -210,7 +211,7 @@ base::hash_set<std::string> GetBlacklistedImportantDomains(Profile* profile) {
void PopulateInfoMapWithSiteEngagement(
Profile* profile,
- SiteEngagementService::EngagementLevel minimum_engagement,
+ blink::mojom::EngagementLevel minimum_engagement,
std::map<GURL, double>* engagement_map,
base::hash_map<std::string, ImportantDomainInfo>* output) {
SiteEngagementService* service = SiteEngagementService::Get(profile);
@@ -275,7 +276,7 @@ void PopulateInfoMapWithBookmarks(
[service](const BookmarkModel::URLAndTitle& entry) {
return service->IsEngagementAtLeast(
entry.url.GetOrigin(),
- SiteEngagementService::ENGAGEMENT_LEVEL_LOW);
+ blink::mojom::EngagementLevel::LOW);
});
std::sort(result_bookmarks.begin(), result_bookmarks.end(),
[&engagement_map](const BookmarkModel::URLAndTitle& a,
@@ -326,7 +327,7 @@ ImportantSitesUtil::GetImportantRegisterableDomains(Profile* profile,
std::map<GURL, double> engagement_map;
PopulateInfoMapWithSiteEngagement(
- profile, SiteEngagementService::ENGAGEMENT_LEVEL_MEDIUM, &engagement_map,
+ profile, blink::mojom::EngagementLevel::MEDIUM, &engagement_map,
&important_info);
PopulateInfoMapWithContentTypeAllowed(
@@ -438,5 +439,5 @@ void ImportantSitesUtil::MarkOriginAsImportantForTesting(Profile* profile,
site_engagement_service->ResetScoreForURL(
origin, SiteEngagementScore::GetMediumEngagementBoundary());
DCHECK(site_engagement_service->IsEngagementAtLeast(
- origin, SiteEngagementService::ENGAGEMENT_LEVEL_MEDIUM));
+ origin, blink::mojom::EngagementLevel::MEDIUM));
}
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/engagement/site_engagement_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698