Chromium Code Reviews| Index: ios/chrome/browser/favicon/favicon_attributes.h |
| diff --git a/ios/chrome/browser/favicon/favicon_attributes.h b/ios/chrome/browser/favicon/favicon_attributes.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fee090983a46ae7ed8708905a82e7d53d793ff6a |
| --- /dev/null |
| +++ b/ios/chrome/browser/favicon/favicon_attributes.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_H_ |
| +#define IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_H_ |
| + |
| +#import <UIKit/UIKit.h> |
| + |
| +// 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
|
| +// with a fallback monogram of a given color and background color. |
| +@interface FaviconAttributes : NSObject |
| + |
| +// Favicon image. Can be nil. If it is nil, monogram string and color are |
| +// guaranteed to be not nil. |
| +@property(nonatomic, readonly, strong, nullable) UIImage* faviconImage; |
| +// Favicon monogram. Only available when there is no image. |
| +@property(nonatomic, readonly, copy, nullable) NSString* monogramString; |
| +// Favicon monogram color. Only available when there is no image. |
| +@property(nonatomic, readonly, strong, nullable) UIColor* textColor; |
| +// Favicon monogram background color. Only available when there is no image. |
| +@property(nonatomic, readonly, strong, nullable) UIColor* backgroundColor; |
| + |
| ++ (instancetype _Nonnull)attributesWithImage:(UIImage* _Nonnull)image; |
| ++ (instancetype _Nonnull)attributesWithMonogram:(NSString* _Nonnull)monogram |
| + textColor:(UIColor* _Nonnull)textColor |
| + backgroundColor: |
| + (UIColor* _Nonnull)backgroundColor; |
| + |
| +// Designated initializer. Either |image| or all of |textColor|, |
| +// |backgroundColor| and |monogram| must be not nil. |
| +- (instancetype _Nonnull)initWithImage:(UIImage* _Nullable)image |
| + monogram:(NSString* _Nullable)monogram |
| + textColor:(UIColor* _Nullable)textColor |
| + backgroundColor:(UIColor* _Nullable)backgroundColor |
| + NS_DESIGNATED_INITIALIZER; |
| +- (instancetype _Nonnull)initWithImage:(UIImage* _Nonnull)image; |
| +- (instancetype _Nonnull)initWithMonogram:(NSString* _Nonnull)monogram |
| + textColor:(UIColor* _Nonnull)textColor |
| + backgroundColor:(UIColor* _Nonnull)backgroundColor; |
| + |
| +- (instancetype _Nullable)init NS_UNAVAILABLE; |
| +@end |
| + |
| +#endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_ATTRIBUTES_H_ |