OLD | NEW |
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/ui/settings/material_cell_catalog_view_controller.h" | 5 #import "ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
10 #include "components/autofill/core/browser/autofill_data_util.h" | 10 #include "components/autofill/core/browser/autofill_data_util.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ItemTypeAutofillStorageSwitch, | 93 ItemTypeAutofillStorageSwitch, |
94 ItemTypeAccountControlDynamicHeight, | 94 ItemTypeAccountControlDynamicHeight, |
95 ItemTypeFooter, | 95 ItemTypeFooter, |
96 ItemTypeContentSuggestions, | 96 ItemTypeContentSuggestions, |
97 }; | 97 }; |
98 | 98 |
99 // Image fixed horizontal size. | 99 // Image fixed horizontal size. |
100 const CGFloat kHorizontalImageFixedSize = 40; | 100 const CGFloat kHorizontalImageFixedSize = 40; |
101 | 101 |
102 // Credit Card icon size. | 102 // Credit Card icon size. |
103 const CGFloat kCardTypeIconDimension = 25.0; | 103 const CGFloat kCardIssuerNetworkIconDimension = 25.0; |
104 | 104 |
105 } // namespace | 105 } // namespace |
106 | 106 |
107 @implementation MaterialCellCatalogViewController | 107 @implementation MaterialCellCatalogViewController |
108 | 108 |
109 - (instancetype)init { | 109 - (instancetype)init { |
110 self = [super initWithStyle:CollectionViewControllerStyleAppBar]; | 110 self = [super initWithStyle:CollectionViewControllerStyleAppBar]; |
111 if (self) { | 111 if (self) { |
112 [self loadModel]; | 112 [self loadModel]; |
113 } | 113 } |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 autofill::kMasterCard, | 579 autofill::kMasterCard, |
580 autofill::kAmericanExpressCard, | 580 autofill::kAmericanExpressCard, |
581 autofill::kJCBCard, | 581 autofill::kJCBCard, |
582 autofill::kDinersCard, | 582 autofill::kDinersCard, |
583 autofill::kDiscoverCard}; | 583 autofill::kDiscoverCard}; |
584 for (const std::string& cardType : cardTypes) { | 584 for (const std::string& cardType : cardTypes) { |
585 autofill::data_util::PaymentRequestData data = | 585 autofill::data_util::PaymentRequestData data = |
586 autofill::data_util::GetPaymentRequestData(cardType); | 586 autofill::data_util::GetPaymentRequestData(cardType); |
587 UIImage* cardTypeIcon = | 587 UIImage* cardTypeIcon = |
588 ResizeImage(NativeImage(data.icon_resource_id), | 588 ResizeImage(NativeImage(data.icon_resource_id), |
589 CGSizeMake(kCardTypeIconDimension, kCardTypeIconDimension), | 589 CGSizeMake(kCardIssuerNetworkIconDimension, |
| 590 kCardIssuerNetworkIconDimension), |
590 ProjectionMode::kAspectFillNoClipping); | 591 ProjectionMode::kAspectFillNoClipping); |
591 [cardTypeIcons addObject:cardTypeIcon]; | 592 [cardTypeIcons addObject:cardTypeIcon]; |
592 } | 593 } |
593 item.methodTypeIcons = cardTypeIcons; | 594 item.methodTypeIcons = cardTypeIcons; |
594 return item; | 595 return item; |
595 } | 596 } |
596 | 597 |
597 - (CollectionViewItem*)autofillItemWithMainAndTrailingText { | 598 - (CollectionViewItem*)autofillItemWithMainAndTrailingText { |
598 AutofillDataItem* item = | 599 AutofillDataItem* item = |
599 [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; | 600 [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 - (ContentSuggestionsFooterItem*)contentSuggestionsFooterItem { | 741 - (ContentSuggestionsFooterItem*)contentSuggestionsFooterItem { |
741 ContentSuggestionsFooterItem* footerItem = | 742 ContentSuggestionsFooterItem* footerItem = |
742 [[ContentSuggestionsFooterItem alloc] | 743 [[ContentSuggestionsFooterItem alloc] |
743 initWithType:ItemTypeContentSuggestions | 744 initWithType:ItemTypeContentSuggestions |
744 title:@"Footer title" | 745 title:@"Footer title" |
745 block:nil]; | 746 block:nil]; |
746 return footerItem; | 747 return footerItem; |
747 } | 748 } |
748 | 749 |
749 @end | 750 @end |
OLD | NEW |