Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/autofill/credit_card.h

Issue 2884051: Merge 53276 - AutoFill Empty profiles should not be saved from AutoFillDialog... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/autofill_profile.cc ('k') | chrome/browser/autofill/credit_card.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_
6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ 6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Used by tests. 53 // Used by tests.
54 bool operator==(const CreditCard& creditcard) const; 54 bool operator==(const CreditCard& creditcard) const;
55 bool operator!=(const CreditCard& creditcard) const; 55 bool operator!=(const CreditCard& creditcard) const;
56 void set_label(const string16& label) { label_ = label; } 56 void set_label(const string16& label) { label_ = label; }
57 57
58 // Returns true if |value| is a credit card number. Uses the Luhn formula to 58 // Returns true if |value| is a credit card number. Uses the Luhn formula to
59 // validate the number. 59 // validate the number.
60 static bool IsCreditCardNumber(const string16& text); 60 static bool IsCreditCardNumber(const string16& text);
61 61
62 // Returns true if there are no values (field types) set.
63 bool IsEmpty() const;
64
62 private: 65 private:
63 // The month and year are zero if not present. 66 // The month and year are zero if not present.
64 int Expiration4DigitYear() const { return expiration_year_; } 67 int Expiration4DigitYear() const { return expiration_year_; }
65 int Expiration2DigitYear() const { return expiration_year_ % 100; } 68 int Expiration2DigitYear() const { return expiration_year_ % 100; }
66 string16 ExpirationMonthAsString() const; 69 string16 ExpirationMonthAsString() const;
67 string16 Expiration4DigitYearAsString() const; 70 string16 Expiration4DigitYearAsString() const;
68 string16 Expiration2DigitYearAsString() const; 71 string16 Expiration2DigitYearAsString() const;
69 72
70 // Sets |expiration_month_| to the integer conversion of |text|. 73 // Sets |expiration_month_| to the integer conversion of |text|.
71 void SetExpirationMonthFromString(const string16& text); 74 void SetExpirationMonthFromString(const string16& text);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 string16 billing_address_; 145 string16 billing_address_;
143 146
144 // The unique ID of this credit card. 147 // The unique ID of this credit card.
145 int unique_id_; 148 int unique_id_;
146 }; 149 };
147 150
148 // So we can compare CreditCards with EXPECT_EQ(). 151 // So we can compare CreditCards with EXPECT_EQ().
149 std::ostream& operator<<(std::ostream& os, const CreditCard& creditcard); 152 std::ostream& operator<<(std::ostream& os, const CreditCard& creditcard);
150 153
151 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ 154 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_profile.cc ('k') | chrome/browser/autofill/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698