| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class AutofillMetrics; | 34 class AutofillMetrics; |
| 35 class CreditCard; | 35 class CreditCard; |
| 36 class PersonalDataManager; | 36 class PersonalDataManager; |
| 37 class PrefService; | 37 class PrefService; |
| 38 class ProfileSyncService; | 38 class ProfileSyncService; |
| 39 class TabContents; | 39 class TabContents; |
| 40 typedef TabContents TabContentsWrapper; | 40 typedef TabContents TabContentsWrapper; |
| 41 | 41 |
| 42 struct ViewHostMsg_FrameNavigate_Params; | 42 struct ViewHostMsg_FrameNavigate_Params; |
| 43 | 43 |
| 44 namespace autofill { |
| 45 class PasswordGenerator; |
| 46 } |
| 47 |
| 44 namespace content { | 48 namespace content { |
| 45 class RenderViewHost; | 49 class RenderViewHost; |
| 46 } | 50 } |
| 47 | 51 |
| 48 namespace gfx { | 52 namespace gfx { |
| 49 class Rect; | 53 class Rect; |
| 50 } | 54 } |
| 51 | 55 |
| 52 namespace IPC { | 56 namespace IPC { |
| 53 class Message; | 57 class Message; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Called from our external delegate so they cannot be private. | 93 // Called from our external delegate so they cannot be private. |
| 90 virtual void OnFillAutofillFormData(int query_id, | 94 virtual void OnFillAutofillFormData(int query_id, |
| 91 const webkit::forms::FormData& form, | 95 const webkit::forms::FormData& form, |
| 92 const webkit::forms::FormField& field, | 96 const webkit::forms::FormField& field, |
| 93 int unique_id); | 97 int unique_id); |
| 94 void OnDidShowAutofillSuggestions(bool is_new_popup); | 98 void OnDidShowAutofillSuggestions(bool is_new_popup); |
| 95 void OnDidFillAutofillFormData(const base::TimeTicks& timestamp); | 99 void OnDidFillAutofillFormData(const base::TimeTicks& timestamp); |
| 96 void OnShowAutofillDialog(); | 100 void OnShowAutofillDialog(); |
| 97 void OnDidPreviewAutofillFormData(); | 101 void OnDidPreviewAutofillFormData(); |
| 98 void OnShowPasswordGenerationPopup(const gfx::Rect& bounds, | 102 void OnShowPasswordGenerationPopup(const gfx::Rect& bounds, |
| 103 int max_length, |
| 99 const webkit::forms::PasswordForm& form); | 104 const webkit::forms::PasswordForm& form); |
| 100 | 105 |
| 101 // Remove the credit card or Autofill profile that matches |unique_id| | 106 // Remove the credit card or Autofill profile that matches |unique_id| |
| 102 // from the database. | 107 // from the database. |
| 103 void RemoveAutofillProfileOrCreditCard(int unique_id); | 108 void RemoveAutofillProfileOrCreditCard(int unique_id); |
| 104 | 109 |
| 105 protected: | 110 protected: |
| 106 // Only test code should subclass AutofillManager. | 111 // Only test code should subclass AutofillManager. |
| 107 friend class base::RefCounted<AutofillManager>; | 112 friend class base::RefCounted<AutofillManager>; |
| 108 virtual ~AutofillManager(); | 113 virtual ~AutofillManager(); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 base::TimeTicks initial_interaction_timestamp_; | 359 base::TimeTicks initial_interaction_timestamp_; |
| 355 // If password generation is enabled. We cache this value so that we don't | 360 // If password generation is enabled. We cache this value so that we don't |
| 356 // spam the renderer with messages during startup when the sync state | 361 // spam the renderer with messages during startup when the sync state |
| 357 // is changing rapidly. | 362 // is changing rapidly. |
| 358 bool password_generation_enabled_; | 363 bool password_generation_enabled_; |
| 359 // The ProfileSyncService associated with this tab. This may be NULL in | 364 // The ProfileSyncService associated with this tab. This may be NULL in |
| 360 // testing. | 365 // testing. |
| 361 base::WeakPtr<ProfileSyncService> sync_service_; | 366 base::WeakPtr<ProfileSyncService> sync_service_; |
| 362 // Listens for changes to the 'enabled' state for password generation. | 367 // Listens for changes to the 'enabled' state for password generation. |
| 363 PrefChangeRegistrar registrar_; | 368 PrefChangeRegistrar registrar_; |
| 369 // To be passed to the password generation UI to generate the password. |
| 370 scoped_ptr<autofill::PasswordGenerator> password_generator_; |
| 364 | 371 |
| 365 // Our copy of the form data. | 372 // Our copy of the form data. |
| 366 ScopedVector<FormStructure> form_structures_; | 373 ScopedVector<FormStructure> form_structures_; |
| 367 | 374 |
| 368 // GUID to ID mapping. We keep two maps to convert back and forth. | 375 // GUID to ID mapping. We keep two maps to convert back and forth. |
| 369 mutable std::map<GUIDPair, int> guid_id_map_; | 376 mutable std::map<GUIDPair, int> guid_id_map_; |
| 370 mutable std::map<int, GUIDPair> id_guid_map_; | 377 mutable std::map<int, GUIDPair> id_guid_map_; |
| 371 | 378 |
| 372 // Delegate to perform external processing (display, selection) on | 379 // Delegate to perform external processing (display, selection) on |
| 373 // our behalf. Weak. | 380 // our behalf. Weak. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 392 TestTabContentsWithExternalDelegate); | 399 TestTabContentsWithExternalDelegate); |
| 393 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 400 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
| 394 UserHappinessFormLoadAndSubmission); | 401 UserHappinessFormLoadAndSubmission); |
| 395 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 402 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
| 396 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); | 403 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FormFillDuration); |
| 397 | 404 |
| 398 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 405 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
| 399 }; | 406 }; |
| 400 | 407 |
| 401 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 408 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
| OLD | NEW |