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

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

Issue 2393103002: [Durable] Updated Durable heuristic to use 'important sites' (Closed)
Patch Set: windows test fix Created 4 years, 2 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/important_sites_util.cc
diff --git a/chrome/browser/android/preferences/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc
similarity index 97%
rename from chrome/browser/android/preferences/important_sites_util.cc
rename to chrome/browser/engagement/important_sites_util.cc
index 85103067b8dfdb2f1828cbd70a071ff36b7cafbc..e50ebc914073e6856fb7c5da127303d70bbf5b04 100644
--- a/chrome/browser/android/preferences/important_sites_util.cc
+++ b/chrome/browser/engagement/important_sites_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/android/preferences/important_sites_util.h"
+#include "chrome/browser/engagement/important_sites_util.h"
#include <algorithm>
#include <map>
@@ -84,9 +84,10 @@ enum CrossedReason {
};
CrossedReason GetCrossedReasonFromBitfield(int32_t reason_bitfield) {
- bool durable = reason_bitfield & (1 << ImportantReason::DURABLE);
- bool notifications = reason_bitfield & (1 << ImportantReason::NOTIFICATIONS);
- bool engagement = reason_bitfield & (1 << ImportantReason::ENGAGEMENT);
+ bool durable = (reason_bitfield & (1 << ImportantReason::DURABLE)) != 0;
+ bool notifications =
+ (reason_bitfield & (1 << ImportantReason::NOTIFICATIONS)) != 0;
+ bool engagement = (reason_bitfield & (1 << ImportantReason::ENGAGEMENT)) != 0;
if (durable && notifications && engagement)
return CROSSED_NOTIFICATIONS_AND_DURABLE_AND_ENGAGEMENT;
else if (notifications && durable)
@@ -430,6 +431,7 @@ void ImportantSitesUtil::RecordBlacklistedAndIgnoredImportantSites(
void ImportantSitesUtil::MarkOriginAsImportantForTesting(Profile* profile,
const GURL& origin) {
+ SiteEngagementScore::SetParamValuesForTesting();
// First get data from site engagement.
SiteEngagementService* site_engagement_service =
SiteEngagementService::Get(profile);
« no previous file with comments | « chrome/browser/engagement/important_sites_util.h ('k') | chrome/browser/engagement/important_sites_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698