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

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

Issue 2387823002: Adding ClearBlackList to the PreviewsBlackList and plumbing to UI (Closed)
Patch Set: tbansal comments 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
« no previous file with comments | « components/previews/core/previews_io_data.h ('k') | components/previews/core/previews_opt_out_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_io_data.cc
diff --git a/components/previews/core/previews_io_data.cc b/components/previews/core/previews_io_data.cc
index 02f4b333e9af00ae7f3f0ef3364564d0876ca37b..54b5d0725c0e6c64600462971aa81eadfa030e36 100644
--- a/components/previews/core/previews_io_data.cc
+++ b/components/previews/core/previews_io_data.cc
@@ -7,20 +7,21 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file_path.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/sequenced_task_runner.h"
#include "base/time/default_clock.h"
#include "components/previews/core/previews_black_list.h"
#include "components/previews/core/previews_opt_out_store.h"
#include "components/previews/core/previews_ui_service.h"
+#include "url/gurl.h"
namespace previews {
PreviewsIOData::PreviewsIOData(
const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
: ui_task_runner_(ui_task_runner),
io_task_runner_(io_task_runner),
weak_factory_(this) {}
@@ -43,11 +44,24 @@ void PreviewsIOData::InitializeOnIOThread(
std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store) {
DCHECK(io_task_runner_->BelongsToCurrentThread());
previews_black_list_.reset(
new PreviewsBlackList(std::move(previews_opt_out_store),
base::MakeUnique<base::DefaultClock>()));
ui_task_runner_->PostTask(
FROM_HERE, base::Bind(&PreviewsUIService::SetIOData, previews_ui_service_,
weak_factory_.GetWeakPtr()));
}
+void PreviewsIOData::AddPreviewNavigation(const GURL& url,
+ bool opt_out,
+ PreviewsType type) {
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
+ previews_black_list_->AddPreviewNavigation(url, opt_out, type);
+}
+
+void PreviewsIOData::ClearBlackList(base::Time begin_time,
+ base::Time end_time) {
+ DCHECK(io_task_runner_->BelongsToCurrentThread());
+ previews_black_list_->ClearBlackList(begin_time, end_time);
+}
+
} // namespace previews
« no previous file with comments | « components/previews/core/previews_io_data.h ('k') | components/previews/core/previews_opt_out_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698