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

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

Issue 2361393004: Creates FaviconAttributesProvider. (Closed)
Patch Set: Created 4 years, 3 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_H_
6 #define IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_H_
7
8 #import <UIKit/UIKit.h>
9
10 // Attributes of a favicon. A favicon is represented either with an image or
jif 2016/09/26 10:58:12 Attributes of a FaviconView.
stkhapugin 2016/09/26 15:51:36 No, these are a representation of favicon, not the
11 // with a fallback monogram of a given color and background color.
12 @interface FaviconAttributes : NSObject
13
14 // Favicon image. Can be nil. If it is nil, monogram string and color are
15 // guaranteed to be not nil.
16 @property(nonatomic, readonly, strong, nullable) UIImage* faviconImage;
17 // Favicon monogram. Only available when there is no image.
18 @property(nonatomic, readonly, copy, nullable) NSString* monogramString;
19 // Favicon monogram color. Only available when there is no image.
20 @property(nonatomic, readonly, strong, nullable) UIColor* textColor;
21 // Favicon monogram background color. Only available when there is no image.
22 @property(nonatomic, readonly, strong, nullable) UIColor* backgroundColor;
23
24 + (instancetype _Nonnull)attributesWithImage:(UIImage* _Nonnull)image;
25 + (instancetype _Nonnull)attributesWithMonogram:(NSString* _Nonnull)monogram
26 textColor:(UIColor* _Nonnull)textColor
27 backgroundColor:
28 (UIColor* _Nonnull)backgroundColor;
29
30 // Designated initializer. Either |image| or all of |textColor|,
31 // |backgroundColor| and |monogram| must be not nil.
32 - (instancetype _Nonnull)initWithImage:(UIImage* _Nullable)image
33 monogram:(NSString* _Nullable)monogram
34 textColor:(UIColor* _Nullable)textColor
35 backgroundColor:(UIColor* _Nullable)backgroundColor
36 NS_DESIGNATED_INITIALIZER;
37 - (instancetype _Nonnull)initWithImage:(UIImage* _Nonnull)image;
38 - (instancetype _Nonnull)initWithMonogram:(NSString* _Nonnull)monogram
39 textColor:(UIColor* _Nonnull)textColor
40 backgroundColor:(UIColor* _Nonnull)backgroundColor;
41
42 - (instancetype _Nullable)init NS_UNAVAILABLE;
43 @end
44
45 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698