| 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" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace autofill { | 28 namespace autofill { |
| 29 | 29 |
| 30 class AutofillMetrics; | 30 class AutofillMetrics; |
| 31 class AutofillPopupDelegate; | 31 class AutofillPopupDelegate; |
| 32 class CreditCard; | 32 class CreditCard; |
| 33 class FormStructure; | 33 class FormStructure; |
| 34 class PasswordGenerator; | 34 class PasswordGenerator; |
| 35 class PersonalDataManager; | 35 class PersonalDataManager; |
| 36 struct FormData; | 36 struct FormData; |
| 37 | 37 |
| 38 // TODO(ramankk): Simplify dialog type when removing autocheckout. | |
| 39 enum DialogType { | |
| 40 // Autofill dialog for the Autocheckout feature. | |
| 41 DIALOG_TYPE_AUTOCHECKOUT, | |
| 42 // Autofill dialog for the requestAutocomplete feature. | |
| 43 DIALOG_TYPE_REQUEST_AUTOCOMPLETE, | |
| 44 }; | |
| 45 | |
| 46 // A delegate interface that needs to be supplied to AutofillManager | 38 // A delegate interface that needs to be supplied to AutofillManager |
| 47 // by the embedder. | 39 // by the embedder. |
| 48 // | 40 // |
| 49 // Each delegate instance is associated with a given context within | 41 // Each delegate instance is associated with a given context within |
| 50 // which an AutofillManager is used (e.g. a single tab), so when we | 42 // which an AutofillManager is used (e.g. a single tab), so when we |
| 51 // say "for the delegate" below, we mean "in the execution context the | 43 // say "for the delegate" below, we mean "in the execution context the |
| 52 // delegate is associated with" (e.g. for the tab the AutofillManager is | 44 // delegate is associated with" (e.g. for the tab the AutofillManager is |
| 53 // attached to). | 45 // attached to). |
| 54 class AutofillManagerDelegate { | 46 class AutofillManagerDelegate { |
| 55 public: | 47 public: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 71 // data. |metric_logger| can be used to log user actions. | 63 // data. |metric_logger| can be used to log user actions. |
| 72 virtual void ConfirmSaveCreditCard( | 64 virtual void ConfirmSaveCreditCard( |
| 73 const AutofillMetrics& metric_logger, | 65 const AutofillMetrics& metric_logger, |
| 74 const CreditCard& credit_card, | 66 const CreditCard& credit_card, |
| 75 const base::Closure& save_card_callback) = 0; | 67 const base::Closure& save_card_callback) = 0; |
| 76 | 68 |
| 77 // Causes the dialog for request autocomplete feature to be shown. | 69 // Causes the dialog for request autocomplete feature to be shown. |
| 78 virtual void ShowRequestAutocompleteDialog( | 70 virtual void ShowRequestAutocompleteDialog( |
| 79 const FormData& form, | 71 const FormData& form, |
| 80 const GURL& source_url, | 72 const GURL& source_url, |
| 81 DialogType dialog_type, | |
| 82 const base::Callback<void(const FormStructure*, | 73 const base::Callback<void(const FormStructure*, |
| 83 const std::string&)>& callback) = 0; | 74 const std::string&)>& callback) = 0; |
| 84 | 75 |
| 85 // Shows an Autofill popup with the given |values|, |labels|, |icons|, and | 76 // Shows an Autofill popup with the given |values|, |labels|, |icons|, and |
| 86 // |identifiers| for the element at |element_bounds|. |delegate| will be | 77 // |identifiers| for the element at |element_bounds|. |delegate| will be |
| 87 // notified of popup events. | 78 // notified of popup events. |
| 88 virtual void ShowAutofillPopup( | 79 virtual void ShowAutofillPopup( |
| 89 const gfx::RectF& element_bounds, | 80 const gfx::RectF& element_bounds, |
| 90 base::i18n::TextDirection text_direction, | 81 base::i18n::TextDirection text_direction, |
| 91 const std::vector<base::string16>& values, | 82 const std::vector<base::string16>& values, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 102 // Hide the Autofill popup if one is currently showing. | 93 // Hide the Autofill popup if one is currently showing. |
| 103 virtual void HideAutofillPopup() = 0; | 94 virtual void HideAutofillPopup() = 0; |
| 104 | 95 |
| 105 // Whether the Autocomplete feature of Autofill should be enabled. | 96 // Whether the Autocomplete feature of Autofill should be enabled. |
| 106 virtual bool IsAutocompleteEnabled() = 0; | 97 virtual bool IsAutocompleteEnabled() = 0; |
| 107 }; | 98 }; |
| 108 | 99 |
| 109 } // namespace autofill | 100 } // namespace autofill |
| 110 | 101 |
| 111 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ | 102 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_MANAGER_DELEGATE_H_ |
| OLD | NEW |