OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/autofill/autofill_credit_card_view_controller_mac.h" |
| 6 #include "base/mac_util.h" |
| 7 #include "base/sys_string_conversions.h" |
| 8 #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" |
| 9 #include "chrome/browser/autofill/credit_card.h" |
| 10 |
| 11 @implementation AutoFillCreditCardViewController |
| 12 |
| 13 @synthesize creditCardModel = creditCardModel_; |
| 14 |
| 15 - (id)initWithCreditCard:(const CreditCard&)creditCard { |
| 16 self = [super initWithNibName:@"AutoFillCreditCardFormView" |
| 17 bundle:mac_util::MainAppBundle()]; |
| 18 if (self) { |
| 19 // Pull in the view for initialization. |
| 20 [self view]; |
| 21 |
| 22 // Create the model. |
| 23 [self setCreditCardModel:[[[AutoFillCreditCardModel alloc] |
| 24 initWithCreditCard:creditCard] autorelease]]; |
| 25 |
| 26 // Setup initial state. |
| 27 // TODO(dhollowa): not yet implemented, disabling controls for now. |
| 28 // See http://crbug.com/33029. |
| 29 [billingAddressLabel_ setEnabled:FALSE]; |
| 30 [billingAddressLabel_ setTextColor:[NSColor secondarySelectedControlColor]]; |
| 31 [billingAddressPopup_ removeAllItems]; |
| 32 [billingAddressPopup_ setEnabled:FALSE]; |
| 33 [shippingAddressLabel_ setEnabled:FALSE]; |
| 34 [shippingAddressLabel_ setTextColor: |
| 35 [NSColor secondarySelectedControlColor]]; |
| 36 [shippingAddressPopup_ removeAllItems]; |
| 37 [shippingAddressPopup_ setEnabled:FALSE]; |
| 38 } |
| 39 return self; |
| 40 } |
| 41 |
| 42 - (void)dealloc { |
| 43 [creditCardModel_ release]; |
| 44 [super dealloc]; |
| 45 } |
| 46 |
| 47 - (void)copyModelToCreditCard:(CreditCard*)creditCard { |
| 48 [creditCardModel_ copyModelToCreditCard:creditCard]; |
| 49 } |
| 50 |
| 51 @end |
OLD | NEW |