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

Unified Diff: components/previews/core/previews_black_list.cc

Issue 2878363004: If users clear history, the previews recency rule should be cleared (Closed)
Patch Set: Created 3 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: components/previews/core/previews_black_list.cc
diff --git a/components/previews/core/previews_black_list.cc b/components/previews/core/previews_black_list.cc
index 3baccd5e3e9fd9a00704f9535eb5d6e941945415..c4f0570d1884a13c7e832d2cb8c7f559eb056e6d 100644
--- a/components/previews/core/previews_black_list.cc
+++ b/components/previews/core/previews_black_list.cc
@@ -158,6 +158,14 @@ void PreviewsBlackList::ClearBlackListSync(base::Time begin_time,
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(loaded_);
DCHECK_LE(begin_time, end_time);
+
+ // Clear last_opt_out_time_ if the period being cleared is larger than the
+ // short black list timeout and the last time the user opted out was before
+ // |end_time|.
+ if (end_time - begin_time > params::SingleOptOutDuration() &&
+ last_opt_out_time_ && last_opt_out_time_.value() < end_time) {
+ last_opt_out_time_.reset();
+ }
black_list_item_map_.reset();
host_indifferent_black_list_item_.reset();
loaded_ = false;

Powered by Google App Engine
This is Rietveld 408576698