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_UI_HISTORY_FAVICON_VIEW_PROVIDER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_HISTORY_FAVICON_VIEW_PROVIDER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 namespace favicon { |
| 11 class LargeIconService; |
| 12 } // namespace favicon |
| 13 |
| 14 @class FaviconView; |
| 15 @class FaviconViewProvider; |
| 16 class GURL; |
| 17 |
| 18 // Delegate protocol for FaviconViewProvider. |
| 19 @protocol FaviconViewProviderDelegate<NSObject> |
| 20 // Called when favicon or fallback format has been fetched. |
| 21 - (void)faviconViewProviderFaviconDidLoad:(FaviconViewProvider*)provider; |
| 22 @end |
| 23 |
| 24 // Object to fetch and configure the view for a favicon, or a fallback icon if |
| 25 // there is no favicon image available with large enough resolution. |
| 26 @interface FaviconViewProvider : NSObject |
| 27 // A favicon or fallback format associated with |URL| will be fetched using |
| 28 // |largeIconService|. The favicon will be rendered with height and width equal |
| 29 // to |faviconSize|, and the image will be fetched if the source size is greater |
| 30 // than or equal to |minFaviconSize|. The |delegate| is notified when the |
| 31 // favicon has been loaded, and may be nil. |
| 32 - (instancetype)initWithURL:(const GURL&)URL |
| 33 faviconSize:(CGFloat)faviconSize |
| 34 minFaviconSize:(CGFloat)minFaviconSize |
| 35 largeIconService:(favicon::LargeIconService*)largeIconService |
| 36 delegate:(id<FaviconViewProviderDelegate>)delegate |
| 37 NS_DESIGNATED_INITIALIZER; |
| 38 - (instancetype)init NS_UNAVAILABLE; |
| 39 |
| 40 // View that displays a favicon or fallback icon. |
| 41 @property(nonatomic, readonly) FaviconView* faviconView; |
| 42 |
| 43 @end |
| 44 |
| 45 #endif // IOS_CHROME_BROWSER_UI_HISTORY_FAVICON_VIEW_PROVIDER_H_ |
OLD | NEW |