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/payments/shipping_option_selection_view_controller.h
" | 5 #import "ios/chrome/browser/payments/shipping_option_selection_view_controller.h
" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "components/payments/core/currency_formatter.h" | 10 #include "components/payments/core/currency_formatter.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 - (void)loadModel { | 96 - (void)loadModel { |
97 [super loadModel]; | 97 [super loadModel]; |
98 CollectionViewModel* model = self.collectionViewModel; | 98 CollectionViewModel* model = self.collectionViewModel; |
99 _selectedItem = nil; | 99 _selectedItem = nil; |
100 | 100 |
101 [model addSectionWithIdentifier:SectionIdentifierShippingOption]; | 101 [model addSectionWithIdentifier:SectionIdentifierShippingOption]; |
102 | 102 |
103 if (self.pending) { | 103 if (self.pending) { |
104 StatusItem* statusItem = [[StatusItem alloc] initWithType:ItemTypeSpinner]; | 104 StatusItem* statusItem = [[StatusItem alloc] initWithType:ItemTypeSpinner]; |
105 statusItem.text = | 105 statusItem.text = l10n_util::GetNSString(IDS_PAYMENTS_CHECKING_OPTION); |
106 l10n_util::GetNSString(IDS_IOS_PAYMENT_REQUEST_CHECKING_LABEL); | |
107 [model addItem:statusItem | 106 [model addItem:statusItem |
108 toSectionWithIdentifier:SectionIdentifierShippingOption]; | 107 toSectionWithIdentifier:SectionIdentifierShippingOption]; |
109 return; | 108 return; |
110 } | 109 } |
111 | 110 |
112 if (_errorMessage) { | 111 if (_errorMessage) { |
113 PaymentsTextItem* messageItem = | 112 PaymentsTextItem* messageItem = |
114 [[PaymentsTextItem alloc] initWithType:ItemTypeMessage]; | 113 [[PaymentsTextItem alloc] initWithType:ItemTypeMessage]; |
115 messageItem.text = _errorMessage; | 114 messageItem.text = _errorMessage; |
116 messageItem.image = NativeImage(IDR_IOS_PAYMENTS_WARNING); | 115 messageItem.image = NativeImage(IDR_IOS_PAYMENTS_WARNING); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 hidesInkViewAtIndexPath:(NSIndexPath*)indexPath { | 236 hidesInkViewAtIndexPath:(NSIndexPath*)indexPath { |
238 NSInteger type = [self.collectionViewModel itemTypeForIndexPath:indexPath]; | 237 NSInteger type = [self.collectionViewModel itemTypeForIndexPath:indexPath]; |
239 if (type == ItemTypeMessage) { | 238 if (type == ItemTypeMessage) { |
240 return YES; | 239 return YES; |
241 } else { | 240 } else { |
242 return NO; | 241 return NO; |
243 } | 242 } |
244 } | 243 } |
245 | 244 |
246 @end | 245 @end |
OLD | NEW |