| Index: components/previews/core/previews_io_data.h
|
| diff --git a/components/previews/core/previews_io_data.h b/components/previews/core/previews_io_data.h
|
| index a30ab6ff0764bcf6ce4ce0f443918ca1e6429f42..f6e85331562eaf47f76ed321e31020e3682036ea 100644
|
| --- a/components/previews/core/previews_io_data.h
|
| +++ b/components/previews/core/previews_io_data.h
|
| @@ -8,6 +8,7 @@
|
| #include <memory>
|
| #include <string>
|
|
|
| +#include "base/callback.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| @@ -27,6 +28,8 @@ class PreviewsBlackList;
|
| class PreviewsOptOutStore;
|
| class PreviewsUIService;
|
|
|
| +typedef base::Callback<bool(PreviewsType)> PreviewsIsEnabledCallback;
|
| +
|
| // A class to manage the IO portion of inter-thread communication between
|
| // previews/ objects. Created on the UI thread, but used only on the IO thread
|
| // after initialization.
|
| @@ -40,7 +43,8 @@ class PreviewsIOData : public PreviewsDecider {
|
| // Stores |previews_ui_service| as |previews_ui_service_| and posts a task to
|
| // InitializeOnIOThread on the IO thread.
|
| void Initialize(base::WeakPtr<PreviewsUIService> previews_ui_service,
|
| - std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store);
|
| + std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store,
|
| + const PreviewsIsEnabledCallback& is_enabled_callback);
|
|
|
| // Adds a navigation to |url| to the black list with result |opt_out|.
|
| void AddPreviewNavigation(const GURL& url, bool opt_out, PreviewsType type);
|
| @@ -75,6 +79,9 @@ class PreviewsIOData : public PreviewsDecider {
|
| scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
|
| scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
|
|
|
| + // Whether the preview is enabled. Valid after Initialize() is called.
|
| + PreviewsIsEnabledCallback is_enabled_callback_;
|
| +
|
| base::WeakPtrFactory<PreviewsIOData> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PreviewsIOData);
|
|
|