Chromium Code Reviews| 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_ | |
|
lpromero
2017/03/24 10:36:20
Since this view has quite some logic, can you add
jlebel
2017/03/24 20:59:08
Done.
| |
| 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 SigninPromoViewColdStartMode, | |
| 23 // At least one profile is known and the user can sign without entering their | |
| 24 // password. | |
| 25 SigninPromoViewWarmStartMode, | |
|
msarda
2017/03/22 12:18:38
I think the only difference between warm and cold
jlebel
2017/03/24 20:59:08
Since I would like to keep the chrome icon inside
| |
| 26 }; | |
| 27 | |
| 28 // This class creates an image view, a label and 2 buttons. This view can be | |
| 29 // configured with 2 modes : "Cold Start" and "Warm Start". | |
| 30 // + "Cold Start" mode displays the chrome/chomium icon in the image view, and | |
|
msarda
2017/03/22 12:18:39
I think the imageView should be configured by the
jlebel
2017/03/24 20:59:08
As Louis mention it, it is nicer to keep it in the
| |
| 31 // only displays the primary button. | |
| 32 // + "Warm Start" mode displays the image view (big than the cold start mode), | |
| 33 // displays both buttons. | |
| 34 // | |
| 35 // The owner is in charge to set: | |
| 36 // - the image for |imageView|, using -[SigninPromoView setProfileImage:] | |
|
msarda
2017/03/22 12:18:38
I think the mediator should always set the image t
jlebel
2017/03/24 20:59:08
Acknowledged.
| |
| 37 // (only for "Warm Start") | |
| 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 the text | |
| 51 // label. | |
|
msarda
2017/03/22 12:18:38
s/of the text label./of |textLabel|
jlebel
2017/03/24 20:59:08
Done.
| |
| 52 @property(nonatomic, readonly) CGFloat horizontalPadding; | |
| 53 | |
| 54 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | |
| 55 | |
| 56 // Changes the image in |imageView| with a circular image. Should be called | |
|
lpromero
2017/03/24 10:36:19
Can you be more explicit with the "circular"? The
jlebel
2017/03/24 20:59:08
Done.
| |
| 57 // only with the "Warm Start" mode. The image is not changed when "Cold Start" | |
| 58 // mode. | |
| 59 - (void)setProfileImage:(UIImage*)image; | |
|
msarda
2017/03/22 12:18:39
I think the owner should always set the image (not
lpromero
2017/03/24 10:36:20
The Chrome logo can stay inside this class, to me.
jlebel
2017/03/24 20:59:08
Yes, I have the asset with all colors. I will add
| |
| 60 | |
| 61 @end | |
| 62 | |
| 63 #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGN_PROMO_VIEW_H_ | |
| OLD | NEW |