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

Unified Diff: components/previews/core/previews_ui_service.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_ui_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_ui_service.cc
diff --git a/components/previews/core/previews_ui_service.cc b/components/previews/core/previews_ui_service.cc
index f357893ff5c78e4a1ddbadcc2fa3edf3852761bd..af146cc81f10fa7ebbaa270c3cddd14a7bd3c230 100644
--- a/components/previews/core/previews_ui_service.cc
+++ b/components/previews/core/previews_ui_service.cc
@@ -1,19 +1,20 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/previews/core/previews_ui_service.h"
#include "base/bind.h"
#include "base/single_thread_task_runner.h"
#include "components/previews/core/previews_io_data.h"
+#include "url/gurl.h"
namespace previews {
PreviewsUIService::PreviewsUIService(
PreviewsIOData* previews_io_data,
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store)
: io_task_runner_(io_task_runner), weak_factory_(this) {
previews_io_data->Initialize(weak_factory_.GetWeakPtr(),
std::move(previews_opt_out_store));
@@ -21,11 +22,28 @@ PreviewsUIService::PreviewsUIService(
PreviewsUIService::~PreviewsUIService() {
DCHECK(thread_checker_.CalledOnValidThread());
}
void PreviewsUIService::SetIOData(base::WeakPtr<PreviewsIOData> io_data) {
DCHECK(thread_checker_.CalledOnValidThread());
io_data_ = io_data;
}
+void PreviewsUIService::AddPreviewNavigation(const GURL& url,
+ PreviewsType type,
+ bool opt_out) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ io_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&PreviewsIOData::AddPreviewNavigation, io_data_,
+ url, opt_out, type));
+}
+
+void PreviewsUIService::ClearBlackList(base::Time begin_time,
+ base::Time end_time) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ io_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&PreviewsIOData::ClearBlackList, io_data_,
+ begin_time, end_time));
+}
+
} // namespace previews
« no previous file with comments | « components/previews/core/previews_ui_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698