| 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 real_pan_client_.CancelRequest(); | 771 real_pan_client_.CancelRequest(); |
| 772 driver_->RendererShouldClearPreviewedForm(); | 772 driver_->RendererShouldClearPreviewedForm(); |
| 773 unmasking_card_ = CreditCard(); | 773 unmasking_card_ = CreditCard(); |
| 774 unmask_response_ = UnmaskResponse(); | 774 unmask_response_ = UnmaskResponse(); |
| 775 } | 775 } |
| 776 | 776 |
| 777 IdentityProvider* AutofillManager::GetIdentityProvider() { | 777 IdentityProvider* AutofillManager::GetIdentityProvider() { |
| 778 return client()->GetIdentityProvider(); | 778 return client()->GetIdentityProvider(); |
| 779 } | 779 } |
| 780 | 780 |
| 781 void AutofillManager::OnDidGetRealPan(const std::string& real_pan) { | 781 void AutofillManager::OnDidGetRealPan(AutofillClient::GetRealPanResult result, |
| 782 const std::string& real_pan) { |
| 782 if (!real_pan.empty()) { | 783 if (!real_pan.empty()) { |
| 784 DCHECK_EQ(AutofillClient::SUCCESS, result); |
| 783 credit_card_form_event_logger_->OnDidFillSuggestion(unmasking_card_); | 785 credit_card_form_event_logger_->OnDidFillSuggestion(unmasking_card_); |
| 784 unmasking_card_.set_record_type(CreditCard::FULL_SERVER_CARD); | 786 unmasking_card_.set_record_type(CreditCard::FULL_SERVER_CARD); |
| 785 unmasking_card_.SetNumber(base::UTF8ToUTF16(real_pan)); | 787 unmasking_card_.SetNumber(base::UTF8ToUTF16(real_pan)); |
| 786 if (unmask_response_.should_store_pan) | 788 if (unmask_response_.should_store_pan) |
| 787 personal_data_->UpdateServerCreditCard(unmasking_card_); | 789 personal_data_->UpdateServerCreditCard(unmasking_card_); |
| 788 | 790 |
| 789 FillCreditCardForm(unmasking_query_id_, unmasking_form_, unmasking_field_, | 791 FillCreditCardForm(unmasking_query_id_, unmasking_form_, unmasking_field_, |
| 790 unmasking_card_); | 792 unmasking_card_); |
| 791 } | 793 } |
| 792 | 794 |
| 793 client()->OnUnmaskVerificationResult(!real_pan.empty()); | 795 client()->OnUnmaskVerificationResult(result); |
| 794 } | 796 } |
| 795 | 797 |
| 796 void AutofillManager::OnDidEndTextFieldEditing() { | 798 void AutofillManager::OnDidEndTextFieldEditing() { |
| 797 external_delegate_->DidEndTextFieldEditing(); | 799 external_delegate_->DidEndTextFieldEditing(); |
| 798 } | 800 } |
| 799 | 801 |
| 800 bool AutofillManager::IsAutofillEnabled() const { | 802 bool AutofillManager::IsAutofillEnabled() const { |
| 801 return client_->GetPrefs()->GetBoolean(prefs::kAutofillEnabled); | 803 return client_->GetPrefs()->GetBoolean(prefs::kAutofillEnabled); |
| 802 } | 804 } |
| 803 | 805 |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 return false; | 1463 return false; |
| 1462 | 1464 |
| 1463 // Disregard forms that we wouldn't ever autofill in the first place. | 1465 // Disregard forms that we wouldn't ever autofill in the first place. |
| 1464 if (!form.ShouldBeParsed()) | 1466 if (!form.ShouldBeParsed()) |
| 1465 return false; | 1467 return false; |
| 1466 | 1468 |
| 1467 return true; | 1469 return true; |
| 1468 } | 1470 } |
| 1469 | 1471 |
| 1470 } // namespace autofill | 1472 } // namespace autofill |
| OLD | NEW |