OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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_AUTHENTICATION_SIGN_PROMO_VIEW_H_ | |
6 #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGN_PROMO_VIEW_H_ | |
7 | |
8 #import <UIKit/UIKit.h> | |
9 | |
10 @class MDCFlatButton; | |
11 @class SigninPromoView; | |
12 | |
13 // Configures a SigninPromoView view. | |
14 @protocol SigninPromoViewConfigurator<NSObject> | |
15 | |
16 - (void)configureSigninPromoView:(SigninPromoView*)signinPromoView; | |
17 | |
18 @end | |
19 | |
20 typedef NS_ENUM(NSInteger, SigninPromoViewMode) { | |
21 // No profile is known. | |
22 SigninPromoViewModeColdState, | |
23 // At least one profile is known and the user can sign without entering their | |
24 // password. | |
msarda
2017/03/28 08:12:51
The user will need to enter more than his/her pass
jlebel
2017/03/28 12:27:21
Done.
| |
25 SigninPromoViewModeWarmState, | |
26 }; | |
27 | |
28 // This class creates an image view, a label and 2 buttons. This view can be | |
29 // configured with 2 modes : "Cold State" and "Warm State". | |
30 // + "Cold State" mode displays the chomium icon in the image view, and only | |
31 // displays the primary button. | |
32 // + "Warm State" mode displays the image view (big than the cold state mode), | |
33 // displays both buttons. | |
34 // | |
35 // The owner is in charge to set: | |
msarda
2017/03/28 08:12:51
This comment is now only available for the warm st
jlebel
2017/03/28 12:27:21
Done.
| |
36 // - the image for |imageView|, using -[SigninPromoView setProfileImage:] | |
37 // (only for "Warm State") | |
msarda
2017/03/28 08:12:51
Remove "(only for "Warm State")"
jlebel
2017/03/28 12:27:21
Done.
| |
38 // - the label for |textLabel| | |
39 // - the title for |primaryButton| | |
40 // - the title for |secondaryButton| | |
41 @interface SigninPromoView : UIView | |
42 | |
43 @property(nonatomic) SigninPromoViewMode mode; | |
44 @property(nonatomic, readonly) UIImageView* imageView; | |
45 @property(nonatomic, readonly) UILabel* textLabel; | |
46 @property(nonatomic, readonly) MDCFlatButton* primaryButton; | |
47 @property(nonatomic, readonly) MDCFlatButton* secondaryButton; | |
48 | |
49 // Horizontal padding used for |textLabel|, |primaryButton| and | |
50 // |secondaryButton|. Used to compute the preferred max layout of |textLabel|. | |
msarda
2017/03/28 08:12:51
Is this the max "layout" or "width"?
lpromero
2017/03/28 09:43:15
Both: the preferred max layout width :)
jlebel
2017/03/28 12:27:21
Done.
| |
51 @property(nonatomic, readonly) CGFloat horizontalPadding; | |
52 | |
53 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | |
54 | |
55 // Sets the image in |imageView|. This method will add a circular background | |
56 // using CircularImageFromImage() (so if the image is not squared, it will be | |
57 // cropped first). Should be called only with the "Warm State" mode. The image | |
58 // is not changed when "Cold State" mode. | |
59 - (void)setProfileImage:(UIImage*)image; | |
60 | |
61 @end | |
62 | |
63 #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGN_PROMO_VIEW_H_ | |
OLD | NEW |