| 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_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_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/string16.h" | 11 #include "base/string16.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 15 class PasswordGenerator; | 15 class PasswordGenerator; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 struct PasswordForm; | 19 struct PasswordForm; |
| 20 struct SSLStatus; | 20 struct SSLStatus; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gfx { | 23 namespace gfx { |
| 24 class Rect; | 24 class Rect; |
| 25 class RectF; | 25 class RectF; |
| 26 } | 26 } |
| 27 | 27 |
| 28 class AutofillMetrics; | 28 class AutofillMetrics; |
| 29 class AutofillPopupDelegate; | 29 class AutofillPopupDelegate; |
| 30 class CreditCard; |
| 30 class FormStructure; | 31 class FormStructure; |
| 31 class GURL; | 32 class GURL; |
| 32 class InfoBarService; | 33 class InfoBarService; |
| 33 class PersonalDataManager; | 34 class PersonalDataManager; |
| 34 class PrefService; | 35 class PrefService; |
| 35 class ProfileSyncServiceBase; | 36 class ProfileSyncServiceBase; |
| 36 | 37 |
| 37 struct FormData; | 38 struct FormData; |
| 38 | 39 |
| 39 namespace autofill { | 40 namespace autofill { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 50 // | 51 // |
| 51 // Each delegate instance is associated with a given context within | 52 // Each delegate instance is associated with a given context within |
| 52 // which an AutofillManager is used (e.g. a single tab), so when we | 53 // which an AutofillManager is used (e.g. a single tab), so when we |
| 53 // say "for the delegate" below, we mean "in the execution context the | 54 // say "for the delegate" below, we mean "in the execution context the |
| 54 // delegate is associated with" (e.g. for the tab the AutofillManager is | 55 // delegate is associated with" (e.g. for the tab the AutofillManager is |
| 55 // attached to). | 56 // attached to). |
| 56 class AutofillManagerDelegate { | 57 class AutofillManagerDelegate { |
| 57 public: | 58 public: |
| 58 virtual ~AutofillManagerDelegate() {} | 59 virtual ~AutofillManagerDelegate() {} |
| 59 | 60 |
| 60 // Gets the infobar service associated with the delegate. | |
| 61 virtual InfoBarService* GetInfoBarService() = 0; | |
| 62 | |
| 63 // Gets the PersonalDataManager instance associated with the delegate. | 61 // Gets the PersonalDataManager instance associated with the delegate. |
| 64 virtual PersonalDataManager* GetPersonalDataManager() = 0; | 62 virtual PersonalDataManager* GetPersonalDataManager() = 0; |
| 65 | 63 |
| 66 // Gets the preferences associated with the delegate. | 64 // Gets the preferences associated with the delegate. |
| 67 virtual PrefService* GetPrefs() = 0; | 65 virtual PrefService* GetPrefs() = 0; |
| 68 | 66 |
| 69 // Hides the associated request autocomplete dialog (if it exists). | 67 // Hides the associated request autocomplete dialog (if it exists). |
| 70 virtual void HideRequestAutocompleteDialog() = 0; | 68 virtual void HideRequestAutocompleteDialog() = 0; |
| 71 | 69 |
| 72 // Returns true if saving passwords is currently enabled for the | 70 // Returns true if saving passwords is currently enabled for the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 83 // (e.g. SetSyncStateChangedCallback(base::Closure())). | 81 // (e.g. SetSyncStateChangedCallback(base::Closure())). |
| 84 virtual void SetSyncStateChangedCallback(const base::Closure& callback) = 0; | 82 virtual void SetSyncStateChangedCallback(const base::Closure& callback) = 0; |
| 85 | 83 |
| 86 // Causes an error explaining that Autocheckout has failed to be displayed to | 84 // Causes an error explaining that Autocheckout has failed to be displayed to |
| 87 // the user. | 85 // the user. |
| 88 virtual void OnAutocheckoutError() = 0; | 86 virtual void OnAutocheckoutError() = 0; |
| 89 | 87 |
| 90 // Causes the Autofill settings UI to be shown. | 88 // Causes the Autofill settings UI to be shown. |
| 91 virtual void ShowAutofillSettings() = 0; | 89 virtual void ShowAutofillSettings() = 0; |
| 92 | 90 |
| 91 // Run |save_card_callback| if the credit card should be imported as personal |
| 92 // data. |metric_logger| can be used to log user actions. |
| 93 virtual void ConfirmSaveCreditCard( |
| 94 const AutofillMetrics& metric_logger, |
| 95 const CreditCard& credit_card, |
| 96 const base::Closure& save_card_callback) = 0; |
| 97 |
| 93 // Causes the password generation bubble UI to be shown using the | 98 // Causes the password generation bubble UI to be shown using the |
| 94 // specified form with the given bounds. | 99 // specified form with the given bounds. |
| 95 virtual void ShowPasswordGenerationBubble( | 100 virtual void ShowPasswordGenerationBubble( |
| 96 const gfx::Rect& bounds, | 101 const gfx::Rect& bounds, |
| 97 const content::PasswordForm& form, | 102 const content::PasswordForm& form, |
| 98 autofill::PasswordGenerator* generator) = 0; | 103 autofill::PasswordGenerator* generator) = 0; |
| 99 | 104 |
| 100 // Causes the Autocheckout bubble UI to be displayed. |bounding_box| is the | 105 // Causes the Autocheckout bubble UI to be displayed. |bounding_box| is the |
| 101 // anchor for the bubble. |native_view| is the parent view of the bubble. | 106 // anchor for the bubble. |native_view| is the parent view of the bubble. |
| 102 // |callback| is run if the bubble is accepted. | 107 // |callback| is run if the bubble is accepted. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 131 // Hide the Autofill popup if one is currently showing. | 136 // Hide the Autofill popup if one is currently showing. |
| 132 virtual void HideAutofillPopup() = 0; | 137 virtual void HideAutofillPopup() = 0; |
| 133 | 138 |
| 134 // Updates the Autocheckout progress bar. |value| must be in [0.0, 1.0]. | 139 // Updates the Autocheckout progress bar. |value| must be in [0.0, 1.0]. |
| 135 virtual void UpdateProgressBar(double value) = 0; | 140 virtual void UpdateProgressBar(double value) = 0; |
| 136 }; | 141 }; |
| 137 | 142 |
| 138 } // namespace autofill | 143 } // namespace autofill |
| 139 | 144 |
| 140 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ | 145 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_DELEGATE_H_ |
| OLD | NEW |