OLD | NEW |
---|---|
(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" | |
noyau (Ping after 24h)
2016/10/04 12:05:58
Probably not needed, could be replaced by @class.
| |
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 | |
noyau (Ping after 24h)
2016/10/03 14:52:10
Can't this object be C++?
stkhapugin
2016/10/04 11:47:18
This is basically a UIKit-friendly ObjC wrapper fo
noyau (Ping after 24h)
2016/10/04 12:05:58
I'm not arguing the utility of this class, which h
| |
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)initWithFaviconSize:(CGFloat)faviconSize | |
26 minFaviconSize:(CGFloat)minFaviconSize | |
27 largeIconService:(favicon::LargeIconService*)largeIconService | |
28 NS_DESIGNATED_INITIALIZER; | |
29 - (instancetype)init NS_UNAVAILABLE; | |
30 | |
31 // Fetches favicon attributes and calls the completion block. | |
32 - (void)fetchFaviconAttributesForURL:(const GURL&)URL | |
33 completion:(void (^)(FaviconAttributes*))completion; | |
34 | |
35 // LargeIconService used to fetch favicons. | |
36 @property(nonatomic, readonly) favicon::LargeIconService* largeIconService; | |
37 // Minimal acceptable favicon size. Below that, will fall back to a monogram. | |
38 @property(nonatomic, readonly) CGFloat minSize; | |
39 // Expected favicon size (in points). Will downscale favicon to this. | |
40 @property(nonatomic, readonly) CGFloat faviconSize; | |
41 | |
42 @end | |
43 | |
44 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_PROVIDER_H_ | |
OLD | NEW |