Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chrome/browser/autofill/autofill_manager.cc

Issue 12091086: [Autofill] Add UMA timing metrics for requestAutocomplete dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass along dialog requester Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/autofill_manager.h" 5 #include "chrome/browser/autofill/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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 metric_logger_->LogAddressSuggestionsCount(values.size()); 575 metric_logger_->LogAddressSuggestionsCount(values.size());
576 has_logged_address_suggestions_count_ = true; 576 has_logged_address_suggestions_count_ = true;
577 } 577 }
578 } 578 }
579 } 579 }
580 580
581 // If form is known to be at the start of the autofillable flow (i.e, when 581 // If form is known to be at the start of the autofillable flow (i.e, when
582 // Autofill server said so), then trigger payments UI while also returning 582 // Autofill server said so), then trigger payments UI while also returning
583 // standard autofill suggestions to renderer process. 583 // standard autofill suggestions to renderer process.
584 if (page_meta_data_.IsStartOfAutofillableFlow()) { 584 if (page_meta_data_.IsStartOfAutofillableFlow()) {
585 AutocheckoutInfoBarDelegate::Create( 585 autofill::AutocheckoutInfoBarDelegate::Create(
586 *metric_logger_, 586 *metric_logger_,
587 form.origin, 587 form.origin,
588 form.ssl_status, 588 form.ssl_status,
589 &autocheckout_manager_, 589 &autocheckout_manager_,
590 manager_delegate_->GetInfoBarService()); 590 manager_delegate_->GetInfoBarService());
591 } 591 }
592 } 592 }
593 593
594 // Add the results from AutoComplete. They come back asynchronously, so we 594 // Add the results from AutoComplete. They come back asynchronously, so we
595 // hand off what we generated and they will send the results back to the 595 // hand off what we generated and they will send the results back to the
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 780
781 void AutofillManager::RemoveAutocompleteEntry(const string16& name, 781 void AutofillManager::RemoveAutocompleteEntry(const string16& name,
782 const string16& value) { 782 const string16& value) {
783 autocomplete_history_manager_.OnRemoveAutocompleteEntry(name, value); 783 autocomplete_history_manager_.OnRemoveAutocompleteEntry(name, value);
784 } 784 }
785 785
786 void AutofillManager::ShowRequestAutocompleteDialog( 786 void AutofillManager::ShowRequestAutocompleteDialog(
787 const FormData& form, 787 const FormData& form,
788 const GURL& source_url, 788 const GURL& source_url,
789 const content::SSLStatus& ssl_status, 789 const content::SSLStatus& ssl_status,
790 autofill::AutocompleteDialogRequester requester,
790 const base::Callback<void(const FormStructure*)>& callback) { 791 const base::Callback<void(const FormStructure*)>& callback) {
791 manager_delegate_->ShowRequestAutocompleteDialog( 792 manager_delegate_->ShowRequestAutocompleteDialog(
792 form, source_url, ssl_status, callback); 793 form, source_url, ssl_status, *metric_logger_, requester, callback);
793 } 794 }
794 795
795 void AutofillManager::RequestAutocompleteDialogClosed() { 796 void AutofillManager::RequestAutocompleteDialogClosed() {
796 manager_delegate_->RequestAutocompleteDialogClosed(); 797 manager_delegate_->RequestAutocompleteDialogClosed();
797 } 798 }
798 799
799 void AutofillManager::OnAddPasswordFormMapping( 800 void AutofillManager::OnAddPasswordFormMapping(
800 const FormFieldData& form, 801 const FormFieldData& form,
801 const PasswordFormFillData& fill_data) { 802 const PasswordFormFillData& fill_data) {
802 if (external_delegate_) 803 if (external_delegate_)
(...skipping 30 matching lines...) Expand all
833 const GURL& frame_url, 834 const GURL& frame_url,
834 const content::SSLStatus& ssl_status) { 835 const content::SSLStatus& ssl_status) {
835 if (!IsAutofillEnabled()) { 836 if (!IsAutofillEnabled()) {
836 ReturnAutocompleteResult(WebFormElement::AutocompleteResultErrorDisabled, 837 ReturnAutocompleteResult(WebFormElement::AutocompleteResultErrorDisabled,
837 FormData()); 838 FormData());
838 return; 839 return;
839 } 840 }
840 841
841 base::Callback<void(const FormStructure*)> callback = 842 base::Callback<void(const FormStructure*)> callback =
842 base::Bind(&AutofillManager::ReturnAutocompleteData, this); 843 base::Bind(&AutofillManager::ReturnAutocompleteData, this);
843 ShowRequestAutocompleteDialog(form, frame_url, ssl_status, callback); 844 ShowRequestAutocompleteDialog(
845 form, frame_url, ssl_status,
846 autofill::AUTOCOMPLETE_DIALOG_REQUESTER_REQUEST_AUTOCOMPLETE, callback);
844 } 847 }
845 848
846 void AutofillManager::ReturnAutocompleteResult( 849 void AutofillManager::ReturnAutocompleteResult(
847 WebFormElement::AutocompleteResult result, const FormData& form_data) { 850 WebFormElement::AutocompleteResult result, const FormData& form_data) {
848 // web_contents() will be NULL when the interactive autocomplete is closed due 851 // web_contents() will be NULL when the interactive autocomplete is closed due
849 // to a tab or browser window closing. 852 // to a tab or browser window closing.
850 if (!web_contents()) 853 if (!web_contents())
851 return; 854 return;
852 855
853 RenderViewHost* host = web_contents()->GetRenderViewHost(); 856 RenderViewHost* host = web_contents()->GetRenderViewHost();
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 *profile_guid = IDToGUID(profile_id); 1310 *profile_guid = IDToGUID(profile_id);
1308 } 1311 }
1309 1312
1310 void AutofillManager::UpdateInitialInteractionTimestamp( 1313 void AutofillManager::UpdateInitialInteractionTimestamp(
1311 const TimeTicks& interaction_timestamp) { 1314 const TimeTicks& interaction_timestamp) {
1312 if (initial_interaction_timestamp_.is_null() || 1315 if (initial_interaction_timestamp_.is_null() ||
1313 interaction_timestamp < initial_interaction_timestamp_) { 1316 interaction_timestamp < initial_interaction_timestamp_) {
1314 initial_interaction_timestamp_ = interaction_timestamp; 1317 initial_interaction_timestamp_ = interaction_timestamp;
1315 } 1318 }
1316 } 1319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698