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

Side by Side Diff: ios/chrome/browser/favicon/favicon_attributes_provider.h

Issue 2361393004: Creates FaviconAttributesProvider. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_PROVIDER_H_
6 #define IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_PROVIDER_H_
7
8 #import <UIKit/UIKit.h>
9 #import "ios/chrome/browser/favicon/favicon_attributes.h"
10
11 namespace favicon {
12 class LargeIconService;
13 } // namespace favicon
14
15 @class FaviconViewProvider;
16 class GURL;
17
18 // Object to fetch favicon attributes by URL - an image or a fallback icon if
19 // there is no favicon image available with large enough resolution.
20 @interface FaviconAttributesProvider : NSObject
21 // Favicon attributes associated with |URL| will be fetched using
22 // |largeIconService|. The favicon will be rendered with height and width equal
23 // to |faviconSize|, and the image will be fetched if the source size is greater
24 // than or equal to |minFaviconSize|.
25 - (instancetype _Nonnull)
26 initWithFaviconSize:(CGFloat)faviconSize
27 minFaviconSize:(CGFloat)minFaviconSize
28 largeIconService:(favicon::LargeIconService* _Nonnull)largeIconService
29 NS_DESIGNATED_INITIALIZER;
30 - (instancetype _Nonnull)init NS_UNAVAILABLE;
31
32 // Fetches favicon attributes and calls the completion block.
33 - (void)fetchFaviconAttributesForURL:(const GURL&)URL
34 completion:
35 (void (^_Nonnull)(FaviconAttributes* _Nonnull))
36 completion;
37
38 // LargeIconService used to fetch favicons.
39 @property(nonatomic, readonly, nonnull)
40 favicon::LargeIconService* largeIconService;
41 // Minimal acceptable favicon size. Below that, will fall back to a monogram.
42 @property(nonatomic, readonly) CGFloat minSize;
43 // Expected favicon size (in points). Will downscale favicon to this.
44 @property(nonatomic, readonly) CGFloat faviconSize;
45
46 @end
47
48 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698