| 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 #endif // #if defined(TOOLKIT_VIEWS) | 769 #endif // #if defined(TOOLKIT_VIEWS) |
| 770 | 770 |
| 771 // If the corresponding flag is set, annotate forms with the predicted types. | 771 // If the corresponding flag is set, annotate forms with the predicted types. |
| 772 driver_->SendAutofillTypePredictionsToRenderer(form_structures_.get()); | 772 driver_->SendAutofillTypePredictionsToRenderer(form_structures_.get()); |
| 773 } | 773 } |
| 774 | 774 |
| 775 void AutofillManager::OnDidEndTextFieldEditing() { | 775 void AutofillManager::OnDidEndTextFieldEditing() { |
| 776 external_delegate_->DidEndTextFieldEditing(); | 776 external_delegate_->DidEndTextFieldEditing(); |
| 777 } | 777 } |
| 778 | 778 |
| 779 void AutofillManager::OnClickFailed(autofill::AutocheckoutStatus status) { | 779 void AutofillManager::OnAutocheckoutPageCompleted( |
| 780 autocheckout_manager_.OnClickFailed(status); | 780 autofill::AutocheckoutStatus status) { |
| 781 autocheckout_manager_.OnAutocheckoutPageCompleted(status); |
| 781 } | 782 } |
| 782 | 783 |
| 783 std::string AutofillManager::GetAutocheckoutURLPrefix() const { | 784 std::string AutofillManager::GetAutocheckoutURLPrefix() const { |
| 784 if (!driver_->GetWebContents()) | 785 if (!driver_->GetWebContents()) |
| 785 return std::string(); | 786 return std::string(); |
| 786 | 787 |
| 787 autofill::autocheckout::WhitelistManager* whitelist_manager = | 788 autofill::autocheckout::WhitelistManager* whitelist_manager = |
| 788 manager_delegate_->GetAutocheckoutWhitelistManager(); | 789 manager_delegate_->GetAutocheckoutWhitelistManager(); |
| 789 | 790 |
| 790 return whitelist_manager ? whitelist_manager->GetMatchedURLPrefix( | 791 return whitelist_manager ? whitelist_manager->GetMatchedURLPrefix( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 interaction_time, | 826 interaction_time, |
| 826 submission_time); | 827 submission_time); |
| 827 | 828 |
| 828 if (submitted_form->ShouldBeCrowdsourced()) | 829 if (submitted_form->ShouldBeCrowdsourced()) |
| 829 UploadFormData(*submitted_form); | 830 UploadFormData(*submitted_form); |
| 830 } | 831 } |
| 831 | 832 |
| 832 void AutofillManager::OnMaybeShowAutocheckoutBubble( | 833 void AutofillManager::OnMaybeShowAutocheckoutBubble( |
| 833 const FormData& form, | 834 const FormData& form, |
| 834 const gfx::RectF& bounding_box) { | 835 const gfx::RectF& bounding_box) { |
| 836 DVLOG(2) << "AutofillManager::OnMaybeShowAutocheckoutBubble"; |
| 835 if (!IsAutofillEnabled()) | 837 if (!IsAutofillEnabled()) |
| 836 return; | 838 return; |
| 837 | 839 |
| 838 // Don't show bubble if corresponding FormStructure doesn't have anything to | 840 // Don't show bubble if corresponding FormStructure doesn't have anything to |
| 839 // autofill. | 841 // autofill. |
| 840 FormStructure* cached_form; | 842 FormStructure* cached_form; |
| 841 if (!FindCachedForm(form, &cached_form)) | 843 if (!FindCachedForm(form, &cached_form)) |
| 842 return; | 844 return; |
| 843 | 845 |
| 844 // Don't offer Autocheckout bubble if Autofill server is not aware of this | 846 // Don't offer Autocheckout bubble if Autofill server is not aware of this |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 | 1222 |
| 1221 void AutofillManager::UpdateInitialInteractionTimestamp( | 1223 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1222 const TimeTicks& interaction_timestamp) { | 1224 const TimeTicks& interaction_timestamp) { |
| 1223 if (initial_interaction_timestamp_.is_null() || | 1225 if (initial_interaction_timestamp_.is_null() || |
| 1224 interaction_timestamp < initial_interaction_timestamp_) { | 1226 interaction_timestamp < initial_interaction_timestamp_) { |
| 1225 initial_interaction_timestamp_ = interaction_timestamp; | 1227 initial_interaction_timestamp_ = interaction_timestamp; |
| 1226 } | 1228 } |
| 1227 } | 1229 } |
| 1228 | 1230 |
| 1229 } // namespace autofill | 1231 } // namespace autofill |
| OLD | NEW |