OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 return; | 554 return; |
555 } | 555 } |
556 | 556 |
557 if (is_credit_card && action == AutofillDriver::FORM_DATA_ACTION_FILL) { | 557 if (is_credit_card && action == AutofillDriver::FORM_DATA_ACTION_FILL) { |
558 const CreditCard* card = static_cast<const CreditCard*>(data_model); | 558 const CreditCard* card = static_cast<const CreditCard*>(data_model); |
559 if (card->record_type() == CreditCard::MASKED_SERVER_CARD) { | 559 if (card->record_type() == CreditCard::MASKED_SERVER_CARD) { |
560 unmasking_card_ = *card; | 560 unmasking_card_ = *card; |
561 unmasking_query_id_ = query_id; | 561 unmasking_query_id_ = query_id; |
562 unmasking_form_ = form; | 562 unmasking_form_ = form; |
563 unmasking_field_ = field; | 563 unmasking_field_ = field; |
| 564 // TODO(estade): uncomment this after the demo. |
| 565 // real_pan_client_.Prepare(); |
564 client()->ShowUnmaskPrompt(unmasking_card_, | 566 client()->ShowUnmaskPrompt(unmasking_card_, |
565 weak_ptr_factory_.GetWeakPtr()); | 567 weak_ptr_factory_.GetWeakPtr()); |
566 return; | 568 return; |
567 } | 569 } |
568 } | 570 } |
569 | 571 |
570 FillOrPreviewDataModelForm(action, query_id, form, field, data_model, variant, | 572 FillOrPreviewDataModelForm(action, query_id, form, field, data_model, variant, |
571 is_credit_card); | 573 is_credit_card); |
572 } | 574 } |
573 | 575 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 } | 703 } |
702 } | 704 } |
703 | 705 |
704 void AutofillManager::OnUnmaskPromptClosed() { | 706 void AutofillManager::OnUnmaskPromptClosed() { |
705 real_pan_client_.CancelRequest(); | 707 real_pan_client_.CancelRequest(); |
706 driver_->RendererShouldClearPreviewedForm(); | 708 driver_->RendererShouldClearPreviewedForm(); |
707 unmasking_card_ = CreditCard(); | 709 unmasking_card_ = CreditCard(); |
708 unmasking_cvc_.clear(); | 710 unmasking_cvc_.clear(); |
709 } | 711 } |
710 | 712 |
| 713 IdentityProvider* AutofillManager::GetIdentityProvider() { |
| 714 return client()->GetIdentityProvider(); |
| 715 } |
| 716 |
711 void AutofillManager::OnDidGetRealPan(const std::string& real_pan) { | 717 void AutofillManager::OnDidGetRealPan(const std::string& real_pan) { |
712 NOTIMPLEMENTED(); | 718 NOTIMPLEMENTED(); |
713 } | 719 } |
714 | 720 |
715 std::string AutofillManager::GetOAuth2Token() { | |
716 NOTIMPLEMENTED(); | |
717 return "would_I_lie_to_you?"; | |
718 } | |
719 | |
720 void AutofillManager::OnUnmaskVerificationResult(bool success) { | 721 void AutofillManager::OnUnmaskVerificationResult(bool success) { |
721 if (success) { | 722 if (success) { |
722 unmasking_card_.set_record_type(CreditCard::FULL_SERVER_CARD); | 723 unmasking_card_.set_record_type(CreditCard::FULL_SERVER_CARD); |
723 if (unmasking_card_.type() == kAmericanExpressCard) { | 724 if (unmasking_card_.type() == kAmericanExpressCard) { |
724 unmasking_card_.SetNumber(base::ASCIIToUTF16("371449635398431")); | 725 unmasking_card_.SetNumber(base::ASCIIToUTF16("371449635398431")); |
725 } else { | 726 } else { |
726 DCHECK_EQ(kDiscoverCard, unmasking_card_.type()); | 727 DCHECK_EQ(kDiscoverCard, unmasking_card_.type()); |
727 unmasking_card_.SetNumber(base::ASCIIToUTF16("6011000990139424")); | 728 unmasking_card_.SetNumber(base::ASCIIToUTF16("6011000990139424")); |
728 } | 729 } |
729 personal_data_->UpdateServerCreditCard(unmasking_card_); | 730 personal_data_->UpdateServerCreditCard(unmasking_card_); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 return false; | 1342 return false; |
1342 | 1343 |
1343 // Disregard forms that we wouldn't ever autofill in the first place. | 1344 // Disregard forms that we wouldn't ever autofill in the first place. |
1344 if (!form.ShouldBeParsed()) | 1345 if (!form.ShouldBeParsed()) |
1345 return false; | 1346 return false; |
1346 | 1347 |
1347 return true; | 1348 return true; |
1348 } | 1349 } |
1349 | 1350 |
1350 } // namespace autofill | 1351 } // namespace autofill |
OLD | NEW |