Chromium Code Reviews| 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_DELEGATE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Rect; | 16 class Rect; |
| 17 class RectF; | 17 class RectF; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class GURL; | 20 class GURL; |
| 21 class InfoBarService; | 21 class InfoBarService; |
| 22 class PrefService; | 22 class PrefService; |
| 23 | 23 |
| 24 namespace autofill { | 24 namespace autofill { |
| 25 | 25 |
| 26 class AutofillMetrics; | 26 class AutofillMetrics; |
| 27 class AutofillPopupDelegate; | 27 class AutofillPopupDelegate; |
| 28 class AutofillWebDataService; | |
| 28 class CreditCard; | 29 class CreditCard; |
| 29 class FormStructure; | 30 class FormStructure; |
| 30 class PasswordGenerator; | 31 class PasswordGenerator; |
| 31 class PersonalDataManager; | 32 class PersonalDataManager; |
| 32 struct FormData; | 33 struct FormData; |
| 33 struct PasswordForm; | 34 struct PasswordForm; |
| 34 | 35 |
| 35 // A delegate interface that needs to be supplied to AutofillManager | 36 // A delegate interface that needs to be supplied to AutofillManager |
| 36 // by the embedder. | 37 // by the embedder. |
| 37 // | 38 // |
| 38 // Each delegate instance is associated with a given context within | 39 // Each delegate instance is associated with a given context within |
| 39 // which an AutofillManager is used (e.g. a single tab), so when we | 40 // which an AutofillManager is used (e.g. a single tab), so when we |
| 40 // say "for the delegate" below, we mean "in the execution context the | 41 // say "for the delegate" below, we mean "in the execution context the |
| 41 // delegate is associated with" (e.g. for the tab the AutofillManager is | 42 // delegate is associated with" (e.g. for the tab the AutofillManager is |
| 42 // attached to). | 43 // attached to). |
| 43 class AutofillManagerDelegate { | 44 class AutofillManagerDelegate { |
| 44 public: | 45 public: |
| 45 virtual ~AutofillManagerDelegate() {} | 46 virtual ~AutofillManagerDelegate() {} |
| 46 | 47 |
| 47 // Gets the PersonalDataManager instance associated with the delegate. | 48 // Gets the PersonalDataManager instance associated with the delegate. |
| 48 virtual PersonalDataManager* GetPersonalDataManager() = 0; | 49 virtual PersonalDataManager* GetPersonalDataManager() = 0; |
| 49 | 50 |
| 51 // Gets the AutofillWebDataService instance associated with the delegate. | |
| 52 virtual scoped_refptr<AutofillWebDataService> | |
| 53 GetDatabase() = 0; | |
|
Ilya Sherman
2013/11/14 23:45:55
nit: Looks like this ought to fit on a single line
blundell
2013/11/15 16:04:54
Done.
| |
| 54 | |
| 50 // Gets the preferences associated with the delegate. | 55 // Gets the preferences associated with the delegate. |
| 51 virtual PrefService* GetPrefs() = 0; | 56 virtual PrefService* GetPrefs() = 0; |
| 52 | 57 |
| 53 // Hides the associated request autocomplete dialog (if it exists). | 58 // Hides the associated request autocomplete dialog (if it exists). |
| 54 virtual void HideRequestAutocompleteDialog() = 0; | 59 virtual void HideRequestAutocompleteDialog() = 0; |
| 55 | 60 |
| 56 // Causes the Autofill settings UI to be shown. | 61 // Causes the Autofill settings UI to be shown. |
| 57 virtual void ShowAutofillSettings() = 0; | 62 virtual void ShowAutofillSettings() = 0; |
| 58 | 63 |
| 59 // Run |save_card_callback| if the credit card should be imported as personal | 64 // Run |save_card_callback| if the credit card should be imported as personal |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 98 |
| 94 // Pass the form structures to the password generation manager to detect | 99 // Pass the form structures to the password generation manager to detect |
| 95 // account creation forms. | 100 // account creation forms. |
| 96 virtual void DetectAccountCreationForms( | 101 virtual void DetectAccountCreationForms( |
| 97 const std::vector<autofill::FormStructure*>& forms) = 0; | 102 const std::vector<autofill::FormStructure*>& forms) = 0; |
| 98 }; | 103 }; |
| 99 | 104 |
| 100 } // namespace autofill | 105 } // namespace autofill |
| 101 | 106 |
| 102 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ | 107 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ |
| OLD | NEW |