| Index: components/favicon/core/large_icon_service.h
|
| diff --git a/components/favicon/core/large_icon_service.h b/components/favicon/core/large_icon_service.h
|
| index 73a2698448c9182cb2ac43fd9e7103ba14ad49f2..500e95a2301082a358d77f99d0e7848d37325f31 100644
|
| --- a/components/favicon/core/large_icon_service.h
|
| +++ b/components/favicon/core/large_icon_service.h
|
| @@ -10,6 +10,7 @@
|
| #include "base/macros.h"
|
| #include "base/task/cancelable_task_tracker.h"
|
| #include "components/favicon_base/favicon_callback.h"
|
| +#include "components/image_fetcher/core/image_fetcher.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
|
|
| class GURL;
|
| @@ -18,6 +19,10 @@ namespace base {
|
| class TaskRunner;
|
| }
|
|
|
| +namespace image_fetcher {
|
| +class ImageFetcher;
|
| +}
|
| +
|
| namespace favicon {
|
|
|
| class FaviconService;
|
| @@ -28,7 +33,8 @@ class LargeIconService : public KeyedService {
|
| public:
|
| LargeIconService(
|
| FaviconService* favicon_service,
|
| - const scoped_refptr<base::TaskRunner>& background_task_runner);
|
| + const scoped_refptr<base::TaskRunner>& background_task_runner,
|
| + std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher);
|
| ~LargeIconService() override;
|
|
|
| // Requests the best large icon for the page at |page_url|.
|
| @@ -49,6 +55,26 @@ class LargeIconService : public KeyedService {
|
| const favicon_base::LargeIconCallback& callback,
|
| base::CancelableTaskTracker* tracker);
|
|
|
| + // Fetches the best large icon for the page at |page_url| from a Google
|
| + // favicon server and stores the result in the FaviconService database
|
| + // (implemented in HistoryService). The write will be a no-op if the local
|
| + // favicon database contains an icon for |page_url|, so clients are
|
| + // encouraged to use GetLargeIconOrFallbackStyle() first.
|
| + //
|
| + // A minimum size |min_source_size_in_pixel| can be specified as a constraint.
|
| + //
|
| + // The callback is triggered when the operation finishes, where |success|
|
| + // tells whether the fetch actually managed to database a new icon in the
|
| + // FaviconService.
|
| + //
|
| + // WARNING: This function will share the |page_url| with a Google server. This
|
| + // Can be used only for urls that are not privacy sensitive or for users that
|
| + // sync their history with Google servers.
|
| + void GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache(
|
| + const GURL& page_url,
|
| + int min_source_size_in_pixel,
|
| + const base::Callback<void(bool success)>& callback);
|
| +
|
| private:
|
| FaviconService* favicon_service_;
|
| scoped_refptr<base::TaskRunner> background_task_runner_;
|
| @@ -58,6 +84,8 @@ class LargeIconService : public KeyedService {
|
| // request.
|
| std::vector<int> large_icon_types_;
|
|
|
| + std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(LargeIconService);
|
| };
|
|
|
|
|