OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/ui/authentication/signin_promo_view.h" | 5 #import "ios/chrome/browser/ui/authentication/signin_promo_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" | 8 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
9 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" | 9 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" |
10 #import "ios/chrome/browser/ui/commands/show_signin_command.h" | 10 #import "ios/chrome/browser/ui/commands/show_signin_command.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 _imageView.translatesAutoresizingMaskIntoConstraints = NO; | 54 _imageView.translatesAutoresizingMaskIntoConstraints = NO; |
55 [self addSubview:_imageView]; | 55 [self addSubview:_imageView]; |
56 | 56 |
57 _textLabel = [[UILabel alloc] init]; | 57 _textLabel = [[UILabel alloc] init]; |
58 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; | 58 _textLabel.translatesAutoresizingMaskIntoConstraints = NO; |
59 [self addSubview:_textLabel]; | 59 [self addSubview:_textLabel]; |
60 | 60 |
61 _primaryButton = [[MDCFlatButton alloc] init]; | 61 _primaryButton = [[MDCFlatButton alloc] init]; |
62 _primaryButton.translatesAutoresizingMaskIntoConstraints = NO; | 62 _primaryButton.translatesAutoresizingMaskIntoConstraints = NO; |
63 _primaryButton.accessibilityIdentifier = @"signin_promo_primary_button"; | 63 _primaryButton.accessibilityIdentifier = @"signin_promo_primary_button"; |
| 64 _primaryButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; |
64 [_primaryButton addTarget:self | 65 [_primaryButton addTarget:self |
65 action:@selector(onPrimaryButtonAction:) | 66 action:@selector(onPrimaryButtonAction:) |
66 forControlEvents:UIControlEventTouchUpInside]; | 67 forControlEvents:UIControlEventTouchUpInside]; |
67 [self addSubview:_primaryButton]; | 68 [self addSubview:_primaryButton]; |
68 | 69 |
69 _secondaryButton = [[MDCFlatButton alloc] init]; | 70 _secondaryButton = [[MDCFlatButton alloc] init]; |
70 _secondaryButton.translatesAutoresizingMaskIntoConstraints = NO; | 71 _secondaryButton.translatesAutoresizingMaskIntoConstraints = NO; |
71 _secondaryButton.accessibilityIdentifier = @"signin_promo_secondary_button"; | 72 _secondaryButton.accessibilityIdentifier = @"signin_promo_secondary_button"; |
72 [_secondaryButton addTarget:self | 73 [_secondaryButton addTarget:self |
73 action:@selector(onSecondaryButtonAction:) | 74 action:@selector(onSecondaryButtonAction:) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 target:self | 259 target:self |
259 selector:@selector(accessibilitySecondaryAction:)]; | 260 selector:@selector(accessibilitySecondaryAction:)]; |
260 return @[ primaryCustomAction, secondaryCustomAction ]; | 261 return @[ primaryCustomAction, secondaryCustomAction ]; |
261 } | 262 } |
262 | 263 |
263 - (NSString*)accessibilityLabel { | 264 - (NSString*)accessibilityLabel { |
264 return _textLabel.text; | 265 return _textLabel.text; |
265 } | 266 } |
266 | 267 |
267 @end | 268 @end |
OLD | NEW |