| 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_EXTERNAL_DELEGATE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 int identifier) override; | 44 int identifier) override; |
| 45 void DidAcceptSuggestion(const base::string16& value, | 45 void DidAcceptSuggestion(const base::string16& value, |
| 46 int identifier, | 46 int identifier, |
| 47 int position) override; | 47 int position) override; |
| 48 bool GetDeletionConfirmationText(const base::string16& value, | 48 bool GetDeletionConfirmationText(const base::string16& value, |
| 49 int identifier, | 49 int identifier, |
| 50 base::string16* title, | 50 base::string16* title, |
| 51 base::string16* body) override; | 51 base::string16* body) override; |
| 52 bool RemoveSuggestion(const base::string16& value, int identifier) override; | 52 bool RemoveSuggestion(const base::string16& value, int identifier) override; |
| 53 void ClearPreviewedForm() override; | 53 void ClearPreviewedForm() override; |
| 54 // Returns false for all popups prior to |onQuery|, true for credit card |
| 55 // popups after call to |onQuery|. |
| 56 bool IsCreditCardPopup() override; |
| 54 | 57 |
| 55 // Records and associates a query_id with web form data. Called | 58 // Records and associates a query_id with web form data. Called |
| 56 // when the renderer posts an Autofill query to the browser. |bounds| | 59 // when the renderer posts an Autofill query to the browser. |bounds| |
| 57 // is window relative. We might not want to display the warning if a website | 60 // is window relative. We might not want to display the warning if a website |
| 58 // has disabled Autocomplete because they have their own popup, and showing | 61 // has disabled Autocomplete because they have their own popup, and showing |
| 59 // our popup on to of theirs would be a poor user experience. | 62 // our popup on to of theirs would be a poor user experience. |
| 60 virtual void OnQuery(int query_id, | 63 virtual void OnQuery(int query_id, |
| 61 const FormData& form, | 64 const FormData& form, |
| 62 const FormFieldData& field, | 65 const FormFieldData& field, |
| 63 const gfx::RectF& element_bounds); | 66 const gfx::RectF& element_bounds); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // This function should only get called when there is at least one | 111 // This function should only get called when there is at least one |
| 109 // multi-field suggestion in the list of suggestions. | 112 // multi-field suggestion in the list of suggestions. |
| 110 void ApplyAutofillOptions(std::vector<Suggestion>* suggestions); | 113 void ApplyAutofillOptions(std::vector<Suggestion>* suggestions); |
| 111 | 114 |
| 112 // Insert the data list values at the start of the given list, including | 115 // Insert the data list values at the start of the given list, including |
| 113 // any required separators. Will also go through |suggestions| and remove | 116 // any required separators. Will also go through |suggestions| and remove |
| 114 // duplicate autocomplete (not Autofill) suggestions, keeping their datalist | 117 // duplicate autocomplete (not Autofill) suggestions, keeping their datalist |
| 115 // version. | 118 // version. |
| 116 void InsertDataListValues(std::vector<Suggestion>* suggestions); | 119 void InsertDataListValues(std::vector<Suggestion>* suggestions); |
| 117 | 120 |
| 121 // Returns the text (i.e. |Suggestion| value) for Chrome autofill options. |
| 122 base::string16 GetSettingsSuggestionValue() const; |
| 123 |
| 118 AutofillManager* manager_; // weak. | 124 AutofillManager* manager_; // weak. |
| 119 | 125 |
| 120 // Provides driver-level context to the shared code of the component. Must | 126 // Provides driver-level context to the shared code of the component. Must |
| 121 // outlive this object. | 127 // outlive this object. |
| 122 AutofillDriver* driver_; // weak | 128 AutofillDriver* driver_; // weak |
| 123 | 129 |
| 124 // The ID of the last request sent for form field Autofill. Used to ignore | 130 // The ID of the last request sent for form field Autofill. Used to ignore |
| 125 // out of date responses. | 131 // out of date responses. |
| 126 int query_id_; | 132 int query_id_; |
| 127 | 133 |
| 128 // The current form and field selected by Autofill. | 134 // The current form and field selected by Autofill. |
| 129 FormData query_form_; | 135 FormData query_form_; |
| 130 FormFieldData query_field_; | 136 FormFieldData query_field_; |
| 131 | 137 |
| 132 // The bounds of the form field that user is interacting with. | 138 // The bounds of the form field that user is interacting with. |
| 133 gfx::RectF element_bounds_; | 139 gfx::RectF element_bounds_; |
| 134 | 140 |
| 135 // Does the popup include any Autofill profile or credit card suggestions? | 141 // Does the popup include any Autofill profile or credit card suggestions? |
| 136 bool has_autofill_suggestions_; | 142 bool has_autofill_suggestions_; |
| 137 | 143 |
| 138 // Have we already shown Autofill suggestions for the field the user is | 144 // Have we already shown Autofill suggestions for the field the user is |
| 139 // currently editing? Used to keep track of state for metrics logging. | 145 // currently editing? Used to keep track of state for metrics logging. |
| 140 bool has_shown_popup_for_current_edit_; | 146 bool has_shown_popup_for_current_edit_; |
| 141 | 147 |
| 142 // FIXME | |
| 143 bool should_show_scan_credit_card_; | 148 bool should_show_scan_credit_card_; |
| 149 bool is_credit_card_popup_; |
| 144 | 150 |
| 145 // Whether the credit card signin promo should be shown to the user. | 151 // Whether the credit card signin promo should be shown to the user. |
| 146 bool should_show_cc_signin_promo_; | 152 bool should_show_cc_signin_promo_; |
| 147 | 153 |
| 148 // Whether the access Address Book prompt has ever been shown for the current | 154 // Whether the access Address Book prompt has ever been shown for the current |
| 149 // |query_form_|. This variable is only used on OSX. | 155 // |query_form_|. This variable is only used on OSX. |
| 150 bool has_shown_address_book_prompt; | 156 bool has_shown_address_book_prompt; |
| 151 | 157 |
| 152 // The current data list values. | 158 // The current data list values. |
| 153 std::vector<base::string16> data_list_values_; | 159 std::vector<base::string16> data_list_values_; |
| 154 std::vector<base::string16> data_list_labels_; | 160 std::vector<base::string16> data_list_labels_; |
| 155 | 161 |
| 156 base::WeakPtrFactory<AutofillExternalDelegate> weak_ptr_factory_; | 162 base::WeakPtrFactory<AutofillExternalDelegate> weak_ptr_factory_; |
| 157 | 163 |
| 158 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); | 164 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); |
| 159 }; | 165 }; |
| 160 | 166 |
| 161 } // namespace autofill | 167 } // namespace autofill |
| 162 | 168 |
| 163 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_ | 169 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_ |
| OLD | NEW |