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

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

Issue 2695713004: Add baked-in favicons for default popular sites on NTP (Closed)
Patch Set: Split updating script into internal repo Created 3 years, 9 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_H_ 5 #ifndef COMPONENTS_NTP_TILES_ICON_CACHER_H_
6 #define COMPONENTS_NTP_TILES_ICON_CACHER_H_ 6 #define COMPONENTS_NTP_TILES_ICON_CACHER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "components/ntp_tiles/popular_sites.h" 9 #include "components/ntp_tiles/popular_sites.h"
10 10
11 namespace ntp_tiles { 11 namespace ntp_tiles {
12 12
13 // Ensures that a Popular Sites icon is cached, downloading and saving it if 13 // Ensures that a Popular Sites icon is cached, downloading and saving it if
14 // not. 14 // not.
15 // 15 //
16 // Does not provide any way to get a fetched favicon; use the FaviconService for 16 // Does not provide any way to get a fetched favicon; use the FaviconService for
17 // that. All this interface guarantees is that FaviconService will be able to 17 // that. All this interface guarantees is that FaviconService will be able to
18 // get you an icon (if it exists). 18 // get you an icon (if it exists).
19 class IconCacher { 19 class IconCacher {
20 public: 20 public:
21 virtual ~IconCacher() = default; 21 virtual ~IconCacher() = default;
22 22
23 // Fetches the icon if necessary, then invokes |done| with true if it was 23 // Fetches the icon if necessary, then invokes |done| with true if it was
24 // newly fetched (false if it was already cached or could not be fetched). 24 // newly fetched or a default icon was loaded for the first time.
25 // It's invoked with False if it was already cached or could not be fetched.
26 // The callback will be invoked twice if a default icon was returned in the
27 // first place.
sfiera 2017/02/27 11:42:20 This docstring confuses me, probably because it's
fhorschig 2017/02/28 13:13:12 Dropped the bool. If you don't like this change, I
25 virtual void StartFetch(PopularSites::Site site, 28 virtual void StartFetch(PopularSites::Site site,
26 const base::Callback<void(bool)>& done) = 0; 29 const base::Callback<void(bool)>& icon_available) = 0;
27 }; 30 };
28 31
29 } // namespace ntp_tiles 32 } // namespace ntp_tiles
30 33
31 #endif // COMPONENTS_NTP_TILES_ICON_CACHER_H_ 34 #endif // COMPONENTS_NTP_TILES_ICON_CACHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698