Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: components/autofill/core/browser/autofill_external_delegate.h

Issue 133893004: Allow deleting autofill password suggestions on Shift+Delete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 // TODO(csharp): A lot of the logic in this class is copied from autofillagent. 29 // TODO(csharp): A lot of the logic in this class is copied from autofillagent.
30 // Once Autofill is moved out of WebKit this class should be the only home for 30 // Once Autofill is moved out of WebKit this class should be the only home for
31 // this logic. See http://crbug.com/51644 31 // this logic. See http://crbug.com/51644
32 32
33 // Delegate for in-browser Autocomplete and Autofill display and selection. 33 // Delegate for in-browser Autocomplete and Autofill display and selection.
34 class AutofillExternalDelegate 34 class AutofillExternalDelegate
35 : public AutofillPopupDelegate { 35 : public AutofillPopupDelegate {
36 public: 36 public:
37 // Creates an AutofillExternalDelegate for the specified AutofillManager and 37 // Creates an AutofillExternalDelegate for the specified AutofillManager and
38 // AutofillDriver. 38 // AutofillDriver.
39 AutofillExternalDelegate(AutofillManager* manager, 39 AutofillExternalDelegate(AutofillManager* autofill_manager,
vabr (Chromium) 2014/04/01 16:56:08 Please undo this change (adding the "autofill_" pr
rchtara 2014/04/03 08:44:50 Done.
40 AutofillDriver* driver); 40 AutofillDriver* autofill_driver);
41 virtual ~AutofillExternalDelegate(); 41 virtual ~AutofillExternalDelegate();
42 42
43 // AutofillPopupDelegate implementation. 43 // AutofillPopupDelegate implementation.
44 virtual void OnPopupShown() OVERRIDE; 44 virtual void OnPopupShown() OVERRIDE;
45 virtual void OnPopupHidden() OVERRIDE; 45 virtual void OnPopupHidden() OVERRIDE;
46 virtual bool ShouldRepostEvent(const ui::MouseEvent& event) OVERRIDE; 46 virtual bool ShouldRepostEvent(const ui::MouseEvent& event) OVERRIDE;
47 virtual void DidSelectSuggestion(int identifier) OVERRIDE; 47 virtual void DidSelectSuggestion(int identifier) OVERRIDE;
48 virtual void DidAcceptSuggestion(const base::string16& value, 48 virtual void DidAcceptSuggestion(const base::string16& value,
49 int identifier) OVERRIDE; 49 int identifier) OVERRIDE;
50 virtual void RemoveSuggestion(const base::string16& value, 50 virtual void RemoveSuggestion(const base::string16& value,
(...skipping 15 matching lines...) Expand all
66 66
67 // Records query results and correctly formats them before sending them off 67 // Records query results and correctly formats them before sending them off
68 // to be displayed. Called when an Autofill query result is available. 68 // to be displayed. Called when an Autofill query result is available.
69 virtual void OnSuggestionsReturned( 69 virtual void OnSuggestionsReturned(
70 int query_id, 70 int query_id,
71 const std::vector<base::string16>& values, 71 const std::vector<base::string16>& values,
72 const std::vector<base::string16>& labels, 72 const std::vector<base::string16>& labels,
73 const std::vector<base::string16>& icons, 73 const std::vector<base::string16>& icons,
74 const std::vector<int>& unique_ids); 74 const std::vector<int>& unique_ids);
75 75
76 // Show password suggestions in the popup. 76 // Show password suggestions in the popup.
vabr (Chromium) 2014/04/01 16:56:08 It should be mentioned, what is the purpose of |pa
77 void OnShowPasswordSuggestions(const std::vector<base::string16>& suggestions, 77 void OnShowPasswordSuggestions(const std::vector<base::string16>& suggestions,
78 const std::vector<base::string16>& realms, 78 const std::vector<base::string16>& realms,
79 const FormFieldData& field, 79 const FormFieldData& field,
80 const PasswordForm& password_form,
80 const gfx::RectF& bounds); 81 const gfx::RectF& bounds);
81 82
82 // Set the data list value associated with the current field. 83 // Set the data list value associated with the current field.
83 void SetCurrentDataListValues( 84 void SetCurrentDataListValues(
84 const std::vector<base::string16>& data_list_values, 85 const std::vector<base::string16>& data_list_values,
85 const std::vector<base::string16>& data_list_labels); 86 const std::vector<base::string16>& data_list_labels);
86 87
87 // Inform the delegate that the text field editing has ended. This is 88 // Inform the delegate that the text field editing has ended. This is
88 // used to help record the metrics of when a new popup is shown. 89 // used to help record the metrics of when a new popup is shown.
89 void DidEndTextFieldEditing(); 90 void DidEndTextFieldEditing();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Password Autofill manager, handles all password-related Autofilling. 137 // Password Autofill manager, handles all password-related Autofilling.
137 PasswordAutofillManager password_manager_; 138 PasswordAutofillManager password_manager_;
138 139
139 // The ID of the last request sent for form field Autofill. Used to ignore 140 // The ID of the last request sent for form field Autofill. Used to ignore
140 // out of date responses. 141 // out of date responses.
141 int query_id_; 142 int query_id_;
142 143
143 // The current form and field selected by Autofill. 144 // The current form and field selected by Autofill.
144 FormData query_form_; 145 FormData query_form_;
145 FormFieldData query_field_; 146 FormFieldData query_field_;
147 // The current password selected by Autofill.
148 PasswordForm query_password_form_;
146 149
147 // The bounds of the form field that user is interacting with. 150 // The bounds of the form field that user is interacting with.
148 gfx::RectF element_bounds_; 151 gfx::RectF element_bounds_;
149 152
150 // Should we display a warning if Autofill is disabled? 153 // Should we display a warning if Autofill is disabled?
151 bool display_warning_if_disabled_; 154 bool display_warning_if_disabled_;
152 155
153 // Does the popup include any Autofill profile or credit card suggestions? 156 // Does the popup include any Autofill profile or credit card suggestions?
154 bool has_suggestion_; 157 bool has_suggestion_;
155 158
156 // Have we already shown Autofill suggestions for the field the user is 159 // Have we already shown Autofill suggestions for the field the user is
157 // currently editing? Used to keep track of state for metrics logging. 160 // currently editing? Used to keep track of state for metrics logging.
158 bool has_shown_popup_for_current_edit_; 161 bool has_shown_popup_for_current_edit_;
159 162
160 // The current data list values. 163 // The current data list values.
161 std::vector<base::string16> data_list_values_; 164 std::vector<base::string16> data_list_values_;
162 std::vector<base::string16> data_list_labels_; 165 std::vector<base::string16> data_list_labels_;
163 166
164 base::WeakPtrFactory<AutofillExternalDelegate> weak_ptr_factory_; 167 base::WeakPtrFactory<AutofillExternalDelegate> weak_ptr_factory_;
165 168
166 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); 169 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate);
167 }; 170 };
168 171
169 } // namespace autofill 172 } // namespace autofill
170 173
171 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_ 174 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_EXTERNAL_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698