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> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // not have the necessary information to classify the form at that time) | 160 // not have the necessary information to classify the form at that time) |
161 // so it bypasses the cache and doesn't log the same quality UMA metrics. | 161 // so it bypasses the cache and doesn't log the same quality UMA metrics. |
162 bool UploadPasswordGenerationForm(const FormData& form); | 162 bool UploadPasswordGenerationForm(const FormData& form); |
163 | 163 |
164 // Resets cache. | 164 // Resets cache. |
165 virtual void Reset(); | 165 virtual void Reset(); |
166 | 166 |
167 // Returns the value of the AutofillEnabled pref. | 167 // Returns the value of the AutofillEnabled pref. |
168 virtual bool IsAutofillEnabled() const; | 168 virtual bool IsAutofillEnabled() const; |
169 | 169 |
| 170 base::string16 GetUserNameToRemove(); |
| 171 |
| 172 void SetUserNameToRemove(const base::string16& username_to_remove); |
| 173 |
| 174 |
| 175 inline base::string16 username_to_remove() { |
| 176 return username_to_remove_; |
| 177 } |
| 178 |
| 179 inline void set_username_to_remove( |
| 180 const base::string16& username_to_remove) { |
| 181 username_to_remove_ = username_to_remove; |
| 182 } |
| 183 |
170 protected: | 184 protected: |
171 // Test code should prefer to use this constructor. | 185 // Test code should prefer to use this constructor. |
172 AutofillManager(AutofillDriver* driver, | 186 AutofillManager(AutofillDriver* driver, |
173 autofill::AutofillManagerDelegate* delegate, | 187 autofill::AutofillManagerDelegate* delegate, |
174 PersonalDataManager* personal_data); | 188 PersonalDataManager* personal_data); |
175 | 189 |
176 // Uploads the form data to the Autofill server. | 190 // Uploads the form data to the Autofill server. |
177 virtual void UploadFormData(const FormStructure& submitted_form); | 191 virtual void UploadFormData(const FormStructure& submitted_form); |
178 | 192 |
179 // Logs quality metrics for the |submitted_form| and uploads the form data | 193 // Logs quality metrics for the |submitted_form| and uploads the form data |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 349 |
336 // Delegate to perform external processing (display, selection) on | 350 // Delegate to perform external processing (display, selection) on |
337 // our behalf. Weak. | 351 // our behalf. Weak. |
338 AutofillExternalDelegate* external_delegate_; | 352 AutofillExternalDelegate* external_delegate_; |
339 | 353 |
340 // Delegate used in test to get notifications on certain events. | 354 // Delegate used in test to get notifications on certain events. |
341 autofill::AutofillManagerTestDelegate* test_delegate_; | 355 autofill::AutofillManagerTestDelegate* test_delegate_; |
342 | 356 |
343 base::WeakPtrFactory<AutofillManager> weak_ptr_factory_; | 357 base::WeakPtrFactory<AutofillManager> weak_ptr_factory_; |
344 | 358 |
| 359 // When the user deletes a password suggestion, the associated username is |
| 360 // kept here, so that the password can be removed from the PasswordStore |
| 361 // later. |
| 362 base::string16 username_to_remove_; |
| 363 |
345 friend class AutofillManagerTest; | 364 friend class AutofillManagerTest; |
346 friend class autofill::FormStructureBrowserTest; | 365 friend class autofill::FormStructureBrowserTest; |
347 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 366 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
348 DeterminePossibleFieldTypesForUpload); | 367 DeterminePossibleFieldTypesForUpload); |
349 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 368 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
350 DeterminePossibleFieldTypesForUploadStressTest); | 369 DeterminePossibleFieldTypesForUploadStressTest); |
351 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 370 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
352 DisabledAutofillDispatchesError); | 371 DisabledAutofillDispatchesError); |
353 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressSuggestionsCount); | 372 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AddressSuggestionsCount); |
354 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtPageLoad); | 373 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtPageLoad); |
(...skipping 12 matching lines...) Expand all Loading... |
367 UserHappinessFormLoadAndSubmission); | 386 UserHappinessFormLoadAndSubmission); |
368 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 387 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
369 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 388 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
370 FormSubmittedAutocompleteEnabled); | 389 FormSubmittedAutocompleteEnabled); |
371 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 390 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
372 }; | 391 }; |
373 | 392 |
374 } // namespace autofill | 393 } // namespace autofill |
375 | 394 |
376 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ | 395 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_H_ |
OLD | NEW |