| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/autofill/wallet/wallet_items.h" | 5 #include "chrome/browser/autofill/wallet/wallet_items.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return wallet::WalletItems::MaskedInstrument::EXPIRED; | 46 return wallet::WalletItems::MaskedInstrument::EXPIRED; |
| 47 if (status_string == "BILLING_INCOMPLETE") | 47 if (status_string == "BILLING_INCOMPLETE") |
| 48 return wallet::WalletItems::MaskedInstrument::BILLING_INCOMPLETE; | 48 return wallet::WalletItems::MaskedInstrument::BILLING_INCOMPLETE; |
| 49 return wallet::WalletItems::MaskedInstrument::INAPPLICABLE; | 49 return wallet::WalletItems::MaskedInstrument::INAPPLICABLE; |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // anonymous namespace | 52 } // anonymous namespace |
| 53 | 53 |
| 54 namespace wallet { | 54 namespace wallet { |
| 55 | 55 |
| 56 const char kPrivacyNoticeUrl[] = "https://wallet.google.com/files/privacy.html"; |
| 57 |
| 56 WalletItems::MaskedInstrument::MaskedInstrument( | 58 WalletItems::MaskedInstrument::MaskedInstrument( |
| 57 const std::string& descriptive_name, | 59 const std::string& descriptive_name, |
| 58 const WalletItems::MaskedInstrument::Type& type, | 60 const WalletItems::MaskedInstrument::Type& type, |
| 59 const std::vector<std::string>& supported_currencies, | 61 const std::vector<std::string>& supported_currencies, |
| 60 const std::string& last_four_digits, | 62 const std::string& last_four_digits, |
| 61 int expiration_month, | 63 int expiration_month, |
| 62 int expiration_year, | 64 int expiration_year, |
| 63 const std::string& brand, | 65 const std::string& brand, |
| 64 scoped_ptr<Address> address, | 66 scoped_ptr<Address> address, |
| 65 const WalletItems::MaskedInstrument::Status& status, | 67 const WalletItems::MaskedInstrument::Status& status, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return false; | 198 return false; |
| 197 return true; | 199 return true; |
| 198 } | 200 } |
| 199 | 201 |
| 200 bool WalletItems::MaskedInstrument::operator!=( | 202 bool WalletItems::MaskedInstrument::operator!=( |
| 201 const WalletItems::MaskedInstrument& other) const { | 203 const WalletItems::MaskedInstrument& other) const { |
| 202 return !(*this == other); | 204 return !(*this == other); |
| 203 } | 205 } |
| 204 | 206 |
| 205 WalletItems::LegalDocument::LegalDocument(const std::string& document_id, | 207 WalletItems::LegalDocument::LegalDocument(const std::string& document_id, |
| 206 const std::string& display_name) | 208 const string16& display_name) |
| 207 : document_id_(document_id), | 209 : document_id_(document_id), |
| 208 display_name_(display_name) {} | 210 display_name_(display_name) {} |
| 209 | 211 |
| 210 WalletItems::LegalDocument::~LegalDocument() {} | 212 WalletItems::LegalDocument::~LegalDocument() {} |
| 211 | 213 |
| 212 scoped_ptr<WalletItems::LegalDocument> | 214 scoped_ptr<WalletItems::LegalDocument> |
| 213 WalletItems::LegalDocument::CreateLegalDocument( | 215 WalletItems::LegalDocument::CreateLegalDocument( |
| 214 const base::DictionaryValue& dictionary) { | 216 const base::DictionaryValue& dictionary) { |
| 215 std::string document_id; | 217 std::string document_id; |
| 216 if (!dictionary.GetString("legal_document_id", &document_id)) { | 218 if (!dictionary.GetString("legal_document_id", &document_id)) { |
| 217 DLOG(ERROR) << "Response from Google Wallet missing legal document id"; | 219 DLOG(ERROR) << "Response from Google Wallet missing legal document id"; |
| 218 return scoped_ptr<LegalDocument>(); | 220 return scoped_ptr<LegalDocument>(); |
| 219 } | 221 } |
| 220 | 222 |
| 221 std::string display_name; | 223 string16 display_name; |
| 222 if (!dictionary.GetString("display_name", &display_name)) { | 224 if (!dictionary.GetString("display_name", &display_name)) { |
| 223 DLOG(ERROR) << "Response from Google Wallet missing display name"; | 225 DLOG(ERROR) << "Response from Google Wallet missing display name"; |
| 224 return scoped_ptr<LegalDocument>(); | 226 return scoped_ptr<LegalDocument>(); |
| 225 } | 227 } |
| 226 | 228 |
| 227 return scoped_ptr<LegalDocument>(new LegalDocument(document_id, | 229 return scoped_ptr<LegalDocument>(new LegalDocument(document_id, |
| 228 display_name)); | 230 display_name)); |
| 229 } | 231 } |
| 230 | 232 |
| 231 GURL WalletItems::LegalDocument::GetUrl() { | 233 GURL WalletItems::LegalDocument::GetUrl() { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 required_actions_ == other.required_actions_ && | 367 required_actions_ == other.required_actions_ && |
| 366 obfuscated_gaia_id_ == other.obfuscated_gaia_id_; | 368 obfuscated_gaia_id_ == other.obfuscated_gaia_id_; |
| 367 } | 369 } |
| 368 | 370 |
| 369 bool WalletItems::operator!=(const WalletItems& other) const { | 371 bool WalletItems::operator!=(const WalletItems& other) const { |
| 370 return !(*this == other); | 372 return !(*this == other); |
| 371 } | 373 } |
| 372 | 374 |
| 373 } // namespace wallet | 375 } // namespace wallet |
| 374 | 376 |
| OLD | NEW |