| 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 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_CREDIT_CARD_MODEL_MAC_ | |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_CREDIT_CARD_MODEL_MAC_ | |
| 7 #pragma once | |
| 8 | |
| 9 #import <Cocoa/Cocoa.h> | |
| 10 | |
| 11 class CreditCard; | |
| 12 | |
| 13 // A "model" class used with bindings mechanism and the | |
| 14 // |AutoFillCreditCardViewController| to achieve the form-like view | |
| 15 // of autofill data in the Chrome options UI. | |
| 16 // Model objects are initialized from the given |creditCard| using the | |
| 17 // designated initializer |initWithCreditCard:|. | |
| 18 // Users of this class must be prepared to handle nil string return values. | |
| 19 // The KVO/bindings mechanisms expect this and deal with nil string values | |
| 20 // appropriately. | |
| 21 @interface AutoFillCreditCardModel : NSObject { | |
| 22 @private | |
| 23 // These are not scoped_nsobjects because we use them via KVO/bindings. | |
| 24 NSString* nameOnCard_; | |
| 25 NSString* creditCardNumber_; | |
| 26 NSString* expirationMonth_; | |
| 27 NSString* expirationYear_; | |
| 28 } | |
| 29 | |
| 30 @property(nonatomic, copy) NSString* nameOnCard; | |
| 31 @property(nonatomic, copy) NSString* creditCardNumber; | |
| 32 @property(nonatomic, copy) NSString* expirationMonth; | |
| 33 @property(nonatomic, copy) NSString* expirationYear; | |
| 34 | |
| 35 // Designated initializer. Initializes the property strings to values retrieved | |
| 36 // from the |creditCard| object. | |
| 37 - (id)initWithCreditCard:(const CreditCard&)creditCard; | |
| 38 | |
| 39 // This method copies internal NSString property values into the | |
| 40 // |creditCard| object's fields as appropriate. |creditCard| should never | |
| 41 // be NULL. | |
| 42 - (void)copyModelToCreditCard:(CreditCard*)creditCard; | |
| 43 | |
| 44 @end | |
| 45 | |
| 46 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_CREDIT_CARD_MODEL_MAC_ | |
| OLD | NEW |