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

Side by Side Diff: components/ntp_tiles/icon_cacher_impl.h

Issue 2695713004: Add baked-in favicons for default popular sites on NTP (Closed)
Patch Set: Add default resource attribute to Site Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_ 5 #ifndef COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_
6 #define COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_ 6 #define COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 21 matching lines...) Expand all
32 32
33 namespace ntp_tiles { 33 namespace ntp_tiles {
34 34
35 class IconCacherImpl : public IconCacher { 35 class IconCacherImpl : public IconCacher {
36 public: 36 public:
37 IconCacherImpl(favicon::FaviconService* favicon_service, 37 IconCacherImpl(favicon::FaviconService* favicon_service,
38 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher); 38 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher);
39 ~IconCacherImpl() override; 39 ~IconCacherImpl() override;
40 40
41 void StartFetch(PopularSites::Site site, 41 void StartFetch(PopularSites::Site site,
42 const base::Callback<void(bool)>& done) override; 42 const base::Callback<void(bool)>& done) override;
sfiera 2017/02/16 18:54:16 If I see a callback "done" I assume it's going to
fhorschig 2017/02/17 16:24:03 I added a comment and changed the name. Strictly,
43 43
44 private: 44 private:
45 void OnGetFaviconImageForPageURLFinished( 45 void OnGetFaviconImageForPageURLFinished(
46 PopularSites::Site site, 46 PopularSites::Site site,
47 const base::Callback<void(bool)>& done, 47 const base::Callback<void(bool)>& done,
48 const favicon_base::FaviconImageResult& result); 48 const favicon_base::FaviconImageResult& result);
49 49
50 void OnFaviconDownloaded(PopularSites::Site site, 50 void OnFaviconDownloaded(PopularSites::Site site,
51 const base::Callback<void(bool)>& done, 51 const base::Callback<void(bool)>& done,
52 const std::string& id, 52 const std::string& id,
53 const gfx::Image& fetched_image); 53 const gfx::Image& fetched_image);
54 54
55 bool ProvideDefaultIcon(const PopularSites::Site& site);
56 void SaveIconForSite(const PopularSites::Site& site, const gfx::Image image);
57
55 base::CancelableTaskTracker tracker_; 58 base::CancelableTaskTracker tracker_;
56 favicon::FaviconService* const favicon_service_; 59 favicon::FaviconService* const favicon_service_;
57 std::unique_ptr<image_fetcher::ImageFetcher> const image_fetcher_; 60 std::unique_ptr<image_fetcher::ImageFetcher> const image_fetcher_;
58 61
59 DISALLOW_COPY_AND_ASSIGN(IconCacherImpl); 62 DISALLOW_COPY_AND_ASSIGN(IconCacherImpl);
60 }; 63 };
61 64
62 } // namespace ntp_tiles 65 } // namespace ntp_tiles
63 66
64 #endif // COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_ 67 #endif // COMPONENTS_NTP_TILES_ICON_CACHER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698