Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: ios/chrome/browser/payments/cells/page_info_item.mm

Issue 2588913002: EarlGrey tests for Payment Request (base CL) (Closed)
Patch Set: Moved the experimental flag back to the BVC Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/payments/cells/page_info_item.h" 5 #import "ios/chrome/browser/payments/cells/page_info_item.h"
6 6
7 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h" 7 #import "ios/third_party/material_components_ios/src/components/Palettes/src/Mat erialPalettes.h"
8 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h" 8 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h"
9 9
10 #if !defined(__has_feature) || !__has_feature(objc_arc) 10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support." 11 #error "This file requires ARC support."
12 #endif 12 #endif
13 13
14 NSString* const kPageInfoFaviconImageViewId = @"kPageInfoFaviconImageViewId";
15
14 namespace { 16 namespace {
15 // Padding used on the top and bottom edges of the cell. 17 // Padding used on the top and bottom edges of the cell.
16 const CGFloat kVerticalPadding = 12; 18 const CGFloat kVerticalPadding = 12;
17 19
18 // Padding used on the leading and trailing edges of the cell and between the 20 // Padding used on the leading and trailing edges of the cell and between the
19 // favicon and labels. 21 // favicon and labels.
20 const CGFloat kHorizontalPadding = 16; 22 const CGFloat kHorizontalPadding = 16;
21 } 23 }
22 24
23 @implementation PageInfoItem 25 @implementation PageInfoItem
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 @synthesize pageFaviconView = _pageFaviconView; 60 @synthesize pageFaviconView = _pageFaviconView;
59 61
60 - (instancetype)initWithFrame:(CGRect)frame { 62 - (instancetype)initWithFrame:(CGRect)frame {
61 self = [super initWithFrame:frame]; 63 self = [super initWithFrame:frame];
62 if (self) { 64 if (self) {
63 self.isAccessibilityElement = YES; 65 self.isAccessibilityElement = YES;
64 66
65 // Favicon 67 // Favicon
66 _pageFaviconView = [[UIImageView alloc] initWithFrame:CGRectZero]; 68 _pageFaviconView = [[UIImageView alloc] initWithFrame:CGRectZero];
67 _pageFaviconView.translatesAutoresizingMaskIntoConstraints = NO; 69 _pageFaviconView.translatesAutoresizingMaskIntoConstraints = NO;
70 _pageFaviconView.accessibilityIdentifier = kPageInfoFaviconImageViewId;
68 [self.contentView addSubview:_pageFaviconView]; 71 [self.contentView addSubview:_pageFaviconView];
69 72
70 // Page title 73 // Page title
71 _pageTitleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; 74 _pageTitleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
72 _pageTitleLabel.font = 75 _pageTitleLabel.font =
73 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:12]; 76 [[MDFRobotoFontLoader sharedInstance] mediumFontOfSize:12];
74 _pageTitleLabel.textColor = [[MDCPalette greyPalette] tint900]; 77 _pageTitleLabel.textColor = [[MDCPalette greyPalette] tint900];
75 _pageTitleLabel.backgroundColor = [UIColor clearColor]; 78 _pageTitleLabel.backgroundColor = [UIColor clearColor];
76 _pageTitleLabel.translatesAutoresizingMaskIntoConstraints = NO; 79 _pageTitleLabel.translatesAutoresizingMaskIntoConstraints = NO;
77 [self.contentView addSubview:_pageTitleLabel]; 80 [self.contentView addSubview:_pageTitleLabel];
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 155 }
153 156
154 #pragma mark - Accessibility 157 #pragma mark - Accessibility
155 158
156 - (NSString*)accessibilityLabel { 159 - (NSString*)accessibilityLabel {
157 return [NSString stringWithFormat:@"%@, %@", self.pageTitleLabel.text, 160 return [NSString stringWithFormat:@"%@, %@", self.pageTitleLabel.text,
158 self.pageHostLabel.text]; 161 self.pageHostLabel.text];
159 } 162 }
160 163
161 @end 164 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698