| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "components/autofill/core/browser/autocomplete_history_manager.h" | 22 #include "components/autofill/core/browser/autocomplete_history_manager.h" |
| 23 #include "components/autofill/core/browser/autofill_download.h" | 23 #include "components/autofill/core/browser/autofill_download.h" |
| 24 #include "components/autofill/core/browser/autofill_driver.h" | 24 #include "components/autofill/core/browser/autofill_driver.h" |
| 25 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 25 #include "components/autofill/core/browser/autofill_manager_delegate.h" |
| 26 #include "components/autofill/core/browser/form_structure.h" | 26 #include "components/autofill/core/browser/form_structure.h" |
| 27 #include "components/autofill/core/browser/personal_data_manager.h" | 27 #include "components/autofill/core/browser/personal_data_manager.h" |
| 28 #include "components/autofill/core/common/form_data.h" | 28 #include "components/autofill/core/common/form_data.h" |
| 29 #include "components/autofill/core/common/forms_seen_state.h" |
| 29 | 30 |
| 30 class GURL; | 31 class GURL; |
| 31 | 32 |
| 32 namespace content { | 33 namespace content { |
| 33 class RenderViewHost; | 34 class RenderViewHost; |
| 34 class WebContents; | 35 class WebContents; |
| 35 } | 36 } |
| 36 | 37 |
| 37 namespace gfx { | 38 namespace gfx { |
| 38 class Rect; | 39 class Rect; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 autofill::AutofillManagerDelegate* delegate() const { | 112 autofill::AutofillManagerDelegate* delegate() const { |
| 112 return manager_delegate_; | 113 return manager_delegate_; |
| 113 } | 114 } |
| 114 | 115 |
| 115 const std::string& app_locale() const { return app_locale_; } | 116 const std::string& app_locale() const { return app_locale_; } |
| 116 | 117 |
| 117 // Only for testing. | 118 // Only for testing. |
| 118 void SetTestDelegate(autofill::AutofillManagerTestDelegate* delegate); | 119 void SetTestDelegate(autofill::AutofillManagerTestDelegate* delegate); |
| 119 | 120 |
| 120 void OnFormsSeen(const std::vector<FormData>& forms, | 121 void OnFormsSeen(const std::vector<FormData>& forms, |
| 121 const base::TimeTicks& timestamp); | 122 const base::TimeTicks& timestamp, |
| 123 autofill::FormsSeenState state); |
| 122 | 124 |
| 123 // Processes the submitted |form|, saving any new Autofill data and uploading | 125 // Processes the submitted |form|, saving any new Autofill data and uploading |
| 124 // the possible field types for the submitted fields to the crowdsourcing | 126 // the possible field types for the submitted fields to the crowdsourcing |
| 125 // server. Returns false if this form is not relevant for Autofill. | 127 // server. Returns false if this form is not relevant for Autofill. |
| 126 bool OnFormSubmitted(const FormData& form, | 128 bool OnFormSubmitted(const FormData& form, |
| 127 const base::TimeTicks& timestamp); | 129 const base::TimeTicks& timestamp); |
| 128 | 130 |
| 129 void OnTextFieldDidChange(const FormData& form, | 131 void OnTextFieldDidChange(const FormData& form, |
| 130 const FormFieldData& field, | 132 const FormFieldData& field, |
| 131 const base::TimeTicks& timestamp); | 133 const base::TimeTicks& timestamp); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 bool has_logged_address_suggestions_count_; | 313 bool has_logged_address_suggestions_count_; |
| 312 // Have we shown Autofill suggestions at least once? | 314 // Have we shown Autofill suggestions at least once? |
| 313 bool did_show_suggestions_; | 315 bool did_show_suggestions_; |
| 314 // Has the user manually edited at least one form field among the autofillable | 316 // Has the user manually edited at least one form field among the autofillable |
| 315 // ones? | 317 // ones? |
| 316 bool user_did_type_; | 318 bool user_did_type_; |
| 317 // Has the user autofilled a form on this page? | 319 // Has the user autofilled a form on this page? |
| 318 bool user_did_autofill_; | 320 bool user_did_autofill_; |
| 319 // Has the user edited a field that was previously autofilled? | 321 // Has the user edited a field that was previously autofilled? |
| 320 bool user_did_edit_autofilled_field_; | 322 bool user_did_edit_autofilled_field_; |
| 321 // When the form finished loading. | 323 // When the page finished loading. |
| 322 std::map<FormData, base::TimeTicks> forms_loaded_timestamps_; | 324 base::TimeTicks forms_loaded_timestamp_; |
| 323 // When the user first interacted with a potentially fillable form on this | 325 // When the user first interacted with a potentially fillable form on this |
| 324 // page. | 326 // page. |
| 325 base::TimeTicks initial_interaction_timestamp_; | 327 base::TimeTicks initial_interaction_timestamp_; |
| 326 | 328 |
| 327 // Our copy of the form data. | 329 // Our copy of the form data. |
| 328 ScopedVector<FormStructure> form_structures_; | 330 ScopedVector<FormStructure> form_structures_; |
| 329 | 331 |
| 330 // GUID to ID mapping. We keep two maps to convert back and forth. | 332 // GUID to ID mapping. We keep two maps to convert back and forth. |
| 331 mutable std::map<PersonalDataManager::GUIDPair, int> guid_id_map_; | 333 mutable std::map<PersonalDataManager::GUIDPair, int> guid_id_map_; |
| 332 mutable std::map<int, PersonalDataManager::GUIDPair> id_guid_map_; | 334 mutable std::map<int, PersonalDataManager::GUIDPair> id_guid_map_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 UserHappinessFormLoadAndSubmission); | 367 UserHappinessFormLoadAndSubmission); |
| 366 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 368 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
| 367 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 369 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
| 368 FormSubmittedAutocompleteEnabled); | 370 FormSubmittedAutocompleteEnabled); |
| 369 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 371 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 370 }; | 372 }; |
| 371 | 373 |
| 372 } // namespace autofill | 374 } // namespace autofill |
| 373 | 375 |
| 374 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 376 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
| OLD | NEW |