OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/autofill/core/browser/autofill_data_util.h" | 5 #include "components/autofill/core/browser/autofill_data_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/i18n/char_iterator.h" | 10 #include "base/i18n/char_iterator.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 // LastFirst | 376 // LastFirst |
377 candidate = profile.GetRawInfo(autofill::NAME_LAST) + | 377 candidate = profile.GetRawInfo(autofill::NAME_LAST) + |
378 profile.GetRawInfo(autofill::NAME_FIRST); | 378 profile.GetRawInfo(autofill::NAME_FIRST); |
379 if (!full_name.compare(candidate)) { | 379 if (!full_name.compare(candidate)) { |
380 return true; | 380 return true; |
381 } | 381 } |
382 | 382 |
383 return false; | 383 return false; |
384 } | 384 } |
385 | 385 |
386 const PaymentRequestData& GetPaymentRequestData(const std::string& type) { | |
387 for (size_t i = 0; i < arraysize(kPaymentRequestData); ++i) { | |
388 if (type == kPaymentRequestData[i].card_type) | |
389 return kPaymentRequestData[i]; | |
390 } | |
391 return kPaymentRequestData[0]; | |
Evan Stade
2016/08/29 20:34:05
seems fairly fragile that you're depending on the
Justin Donnelly
2016/08/30 15:21:25
Done.
| |
392 } | |
393 | |
394 const char* GetCardTypeForBasicCardPaymentType( | |
395 const std::string& basic_card_payment_type) { | |
396 for (size_t i = 0; i < arraysize(kPaymentRequestData); ++i) { | |
397 if (basic_card_payment_type == | |
398 kPaymentRequestData[i].basic_card_payment_type) | |
399 return kPaymentRequestData[i].card_type; | |
400 } | |
401 return kPaymentRequestData[0].card_type; | |
402 } | |
403 | |
386 } // namespace data_util | 404 } // namespace data_util |
387 } // namespace autofill | 405 } // namespace autofill |
OLD | NEW |