Commit c0c95c9b authored by Sebastien Lalancette's avatar Sebastien Lalancette Committed by Commit Bot

Changed ConfirmationAlertViewController imageNamed to image.

Allows usage of this ViewController when we don't have a named image.

Bug: 1064990
Change-Id: I53191d86f83fb552042f3f30c2de4bd954b30d09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152896Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Commit-Queue: Sebastien Lalancette <seblalancette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760037}
parent a09d235d
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#pragma mark - Public #pragma mark - Public
- (void)loadView { - (void)loadView {
self.imageName = @"password_breach_illustration"; self.image = [UIImage imageNamed:@"password_breach_illustration"];
self.helpButtonAvailable = YES; self.helpButtonAvailable = YES;
[super loadView]; [super loadView];
} }
......
...@@ -33,8 +33,8 @@ extern NSString* const kConfirmationAlertPrimaryActionAccessibilityIdentifier; ...@@ -33,8 +33,8 @@ extern NSString* const kConfirmationAlertPrimaryActionAccessibilityIdentifier;
// The text for the primary action. Must be set before the view is loaded. // The text for the primary action. Must be set before the view is loaded.
@property(nonatomic, strong) NSString* primaryActionString; @property(nonatomic, strong) NSString* primaryActionString;
// The image name. Must be set before the view is loaded. // The image. Must be set before the view is loaded.
@property(nonatomic, strong) NSString* imageName; @property(nonatomic, strong) UIImage* image;
// Controls if there is a help button in the view. Must be set before the // Controls if there is a help button in the view. Must be set before the
// view is loaded. // view is loaded.
......
...@@ -285,8 +285,7 @@ constexpr CGFloat kSafeAreaMultiplier = 0.8; ...@@ -285,8 +285,7 @@ constexpr CGFloat kSafeAreaMultiplier = 0.8;
// Helper to create the image view. // Helper to create the image view.
- (UIImageView*)createImageView { - (UIImageView*)createImageView {
UIImage* image = [UIImage imageNamed:self.imageName]; UIImageView* imageView = [[UIImageView alloc] initWithImage:self.image];
UIImageView* imageView = [[UIImageView alloc] initWithImage:image];
imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.translatesAutoresizingMaskIntoConstraints = NO; imageView.translatesAutoresizingMaskIntoConstraints = NO;
return imageView; return imageView;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#pragma mark - Public #pragma mark - Public
- (void)loadView { - (void)loadView {
self.imageName = @"consent_illustration"; self.image = [UIImage imageNamed:@"consent_illustration"];
self.helpButtonAvailable = YES; self.helpButtonAvailable = YES;
self.primaryActionAvailable = YES; self.primaryActionAvailable = YES;
NSString* titleString = NSString* titleString =
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#pragma mark - Public #pragma mark - Public
- (void)loadView { - (void)loadView {
self.imageName = @"empty_credentials_illustration"; self.image = [UIImage imageNamed:@"empty_credentials_illustration"];
self.helpButtonAvailable = NO; self.helpButtonAvailable = NO;
self.primaryActionAvailable = NO; self.primaryActionAvailable = NO;
NSString* titleString = NSString* titleString =
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#pragma mark - Public #pragma mark - Public
- (void)loadView { - (void)loadView {
self.imageName = @"stale_credentials_illustration"; self.image = [UIImage imageNamed:@"stale_credentials_illustration"];
self.helpButtonAvailable = NO; self.helpButtonAvailable = NO;
self.primaryActionAvailable = NO; self.primaryActionAvailable = NO;
NSString* titleString = NSString* titleString =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment