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

Unified Diff: components/previews/core/previews_ui_service.h

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_opt_out_store.h ('k') | components/previews/core/previews_ui_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_ui_service.h
diff --git a/components/previews/core/previews_ui_service.h b/components/previews/core/previews_ui_service.h
index 4fcc4c6094da9bef03c1344db541ea07a27dbc5e..74b9512ba00c9fc800a5b8dc35197128057f33c4 100644
--- a/components/previews/core/previews_ui_service.h
+++ b/components/previews/core/previews_ui_service.h
@@ -7,20 +7,22 @@
#include <string>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "components/previews/core/previews_opt_out_store.h"
+class GURL;
+
namespace base {
class SingleThreadTaskRunner;
}
namespace previews {
class PreviewsIOData;
// A class to manage the UI portion of inter-thread communication between
// previews/ objects. Created and used on the UI thread.
class PreviewsUIService {
@@ -28,20 +30,26 @@ class PreviewsUIService {
PreviewsUIService(
PreviewsIOData* previews_io_data,
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store);
virtual ~PreviewsUIService();
// Sets |io_data_| to |io_data| to allow calls from the UI thread to the IO
// thread. Virtualized in testing.
virtual void SetIOData(base::WeakPtr<PreviewsIOData> io_data);
+ // Adds a navigation to |url| to the black list with result |opt_out|.
+ void AddPreviewNavigation(const GURL& url, PreviewsType type, bool opt_out);
+
+ // Clears the history of the black list between |begin_time| and |end_time|.
+ void ClearBlackList(base::Time begin_time, base::Time end_time);
+
private:
// The IO thread portion of the inter-thread communication for previews/.
base::WeakPtr<previews::PreviewsIOData> io_data_;
base::ThreadChecker thread_checker_;
// The IO thread task runner. Used to post tasks to |io_data_|.
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
base::WeakPtrFactory<PreviewsUIService> weak_factory_;
« no previous file with comments | « components/previews/core/previews_opt_out_store.h ('k') | components/previews/core/previews_ui_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698