| Index: chrome/browser/autofill/autofill_manager.cc
|
| diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
|
| index 6f0f8669583478b18b45b4bf83b3f97fd3a4c64c..3db848e950bf3a56fcb64e2ee0b7ac6435654831 100644
|
| --- a/chrome/browser/autofill/autofill_manager.cc
|
| +++ b/chrome/browser/autofill/autofill_manager.cc
|
| @@ -51,6 +51,7 @@
|
| #include "webkit/glue/form_data_predictions.h"
|
| #include "webkit/glue/form_field.h"
|
|
|
| +using base::TimeTicks;
|
| using switches::kEnableAutofillFeedback;
|
| using webkit_glue::FormData;
|
| using webkit_glue::FormDataPredictions;
|
| @@ -302,7 +303,8 @@ bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
|
| return handled;
|
| }
|
|
|
| -void AutofillManager::OnFormSubmitted(const FormData& form) {
|
| +void AutofillManager::OnFormSubmitted(const FormData& form,
|
| + const TimeTicks& timestamp) {
|
| // Let AutoComplete know as well.
|
| tab_contents_wrapper_->autocomplete_history_manager()->OnFormSubmitted(form);
|
|
|
| @@ -335,7 +337,10 @@ void AutofillManager::OnFormSubmitted(const FormData& form) {
|
| if (!personal_data_->profiles().empty() ||
|
| !personal_data_->credit_cards().empty()) {
|
| DeterminePossibleFieldTypesForUpload(&submitted_form);
|
| - submitted_form.LogQualityMetrics(*metric_logger_);
|
| + submitted_form.LogQualityMetrics(*metric_logger_,
|
| + forms_loaded_timestamp_,
|
| + initial_interaction_timestamp_,
|
| + timestamp);
|
|
|
| if (submitted_form.ShouldBeCrowdsourced())
|
| UploadFormData(submitted_form);
|
| @@ -347,7 +352,8 @@ void AutofillManager::OnFormSubmitted(const FormData& form) {
|
| ImportFormData(submitted_form);
|
| }
|
|
|
| -void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms) {
|
| +void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms,
|
| + const TimeTicks& timestamp) {
|
| bool enabled = IsAutofillEnabled();
|
| if (!has_logged_autofill_enabled_) {
|
| metric_logger_->LogIsAutofillEnabledAtPageLoad(enabled);
|
| @@ -357,11 +363,13 @@ void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms) {
|
| if (!enabled)
|
| return;
|
|
|
| + forms_loaded_timestamp_ = timestamp;
|
| ParseForms(forms);
|
| }
|
|
|
| void AutofillManager::OnTextFieldDidChange(const FormData& form,
|
| - const FormField& field) {
|
| + const FormField& field,
|
| + const TimeTicks& timestamp) {
|
| FormStructure* form_structure = NULL;
|
| AutofillField* autofill_field = NULL;
|
| if (!FindCachedFormAndField(form, field, &form_structure, &autofill_field))
|
| @@ -383,6 +391,8 @@ void AutofillManager::OnTextFieldDidChange(const FormData& form,
|
| AutofillMetrics::USER_DID_EDIT_AUTOFILLED_FIELD_ONCE);
|
| }
|
| }
|
| +
|
| + UpdateInitialInteractionTimestamp(timestamp);
|
| }
|
|
|
| void AutofillManager::OnQueryFormFieldAutofill(
|
| @@ -632,7 +642,7 @@ void AutofillManager::OnDidPreviewAutofillFormData() {
|
| }
|
|
|
|
|
| -void AutofillManager::OnDidFillAutofillFormData() {
|
| +void AutofillManager::OnDidFillAutofillFormData(const TimeTicks& timestamp) {
|
| NotificationService::current()->Notify(
|
| chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA,
|
| Source<RenderViewHost>(tab_contents()->render_view_host()),
|
| @@ -644,6 +654,8 @@ void AutofillManager::OnDidFillAutofillFormData() {
|
| metric_logger_->LogUserHappinessMetric(
|
| AutofillMetrics::USER_DID_AUTOFILL_ONCE);
|
| }
|
| +
|
| + UpdateInitialInteractionTimestamp(timestamp);
|
| }
|
|
|
| void AutofillManager::OnDidShowAutofillSuggestions(bool is_new_popup) {
|
| @@ -774,6 +786,8 @@ void AutofillManager::Reset() {
|
| user_did_type_ = false;
|
| user_did_autofill_ = false;
|
| user_did_edit_autofilled_field_ = false;
|
| + forms_loaded_timestamp_ = TimeTicks();
|
| + initial_interaction_timestamp_ = TimeTicks();
|
| }
|
|
|
| AutofillManager::AutofillManager(TabContentsWrapper* tab_contents,
|
| @@ -1150,3 +1164,11 @@ void AutofillManager::UnpackGUIDs(int id,
|
| *cc_guid = IDToGUID(cc_id);
|
| *profile_guid = IDToGUID(profile_id);
|
| }
|
| +
|
| +void AutofillManager::UpdateInitialInteractionTimestamp(
|
| + const TimeTicks& interaction_timestamp) {
|
| + if (initial_interaction_timestamp_.is_null() ||
|
| + interaction_timestamp < initial_interaction_timestamp_) {
|
| + initial_interaction_timestamp_ = interaction_timestamp;
|
| + }
|
| +}
|
|
|