OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.h" | 5 #import "chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" | 10 #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 // Disable first item in menu. @" " is a non-item. | 141 // Disable first item in menu. @" " is a non-item. |
142 [[expirationMonthPopup_ itemAtIndex:0] setEnabled:NO]; | 142 [[expirationMonthPopup_ itemAtIndex:0] setEnabled:NO]; |
143 } | 143 } |
144 | 144 |
145 // Builds array of valid years. Uses special @" " to indicate no selection. | 145 // Builds array of valid years. Uses special @" " to indicate no selection. |
146 - (void)buildExpirationYearContents { | 146 - (void)buildExpirationYearContents { |
147 NSArray* newArray = [NSArray arrayWithObjects:@" ", | 147 NSArray* newArray = [NSArray arrayWithObjects:@" ", |
148 @"2010", @"2011", @"2012", @"2013", @"2014", @"2015", | 148 @"2010", @"2011", @"2012", @"2013", @"2014", @"2015", |
149 @"2016", @"2017", @"2018", @"2019", @"2020", @"2021", nil ]; | 149 @"2016", @"2017", @"2018", @"2019", @"2020", nil ]; |
150 | 150 |
151 [self setExpirationYearContents:newArray]; | 151 [self setExpirationYearContents:newArray]; |
152 | 152 |
153 // If the value from the model is not found in the array then set to the empty | 153 // If the value from the model is not found in the array then set to the empty |
154 // item @" ". | 154 // item @" ". |
155 if ([newArray | 155 if ([newArray |
156 indexOfObject:[creditCardModel_ expirationYear]] == NSNotFound) { | 156 indexOfObject:[creditCardModel_ expirationYear]] == NSNotFound) { |
157 [creditCardModel_ setExpirationYear:@" "]; | 157 [creditCardModel_ setExpirationYear:@" "]; |
158 } | 158 } |
159 | 159 |
160 // Disable first item in menu. @" " is a non-item. | 160 // Disable first item in menu. @" " is a non-item. |
161 [[expirationYearPopup_ itemAtIndex:0] setEnabled:NO]; | 161 [[expirationYearPopup_ itemAtIndex:0] setEnabled:NO]; |
162 } | 162 } |
163 | 163 |
164 @end | 164 @end |
165 | 165 |
OLD | NEW |