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

Side by Side Diff: chrome/browser/autofill/autofill_external_delegate.h

Issue 10073018: Add Delete Support to New Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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 (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_EXTERNAL_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 // this logic. See http://crbug.com/51644 27 // this logic. See http://crbug.com/51644
28 28
29 // Delegate for external processing of Autocomplete and Autofill 29 // Delegate for external processing of Autocomplete and Autofill
30 // display and selection. 30 // display and selection.
31 class AutofillExternalDelegate { 31 class AutofillExternalDelegate {
32 public: 32 public:
33 virtual ~AutofillExternalDelegate(); 33 virtual ~AutofillExternalDelegate();
34 34
35 // When using an external Autofill delegate. Allows Chrome to tell 35 // When using an external Autofill delegate. Allows Chrome to tell
36 // WebKit which Autofill selection has been chosen. 36 // WebKit which Autofill selection has been chosen.
37 // TODO(jrg): add feedback mechanism for hover on relevant platforms. 37 virtual void SelectAutofillSuggestionAtIndex(int unique_id);
38 virtual void SelectAutofillSuggestionAtIndex(int unique_id, int list_index);
39 38
40 // Records and associates a query_id with web form data. Called 39 // Records and associates a query_id with web form data. Called
41 // when the renderer posts an Autofill query to the browser. |bounds| 40 // when the renderer posts an Autofill query to the browser. |bounds|
42 // is window relative. |display_warning_if_disabled| tells us if we should 41 // is window relative. |display_warning_if_disabled| tells us if we should
43 // display warnings (such as autofill is disabled, but had suggestions). 42 // display warnings (such as autofill is disabled, but had suggestions).
44 // We might not want to display the warning if a website has disabled 43 // We might not want to display the warning if a website has disabled
45 // Autocomplete because they have their own popup, and showing our popup 44 // Autocomplete because they have their own popup, and showing our popup
46 // on to of theirs would be a poor user experience. 45 // on to of theirs would be a poor user experience.
47 virtual void OnQuery(int query_id, 46 virtual void OnQuery(int query_id,
48 const webkit::forms::FormData& form, 47 const webkit::forms::FormData& form,
49 const webkit::forms::FormField& field, 48 const webkit::forms::FormField& field,
50 const gfx::Rect& bounds, 49 const gfx::Rect& bounds,
51 bool display_warning_if_disabled); 50 bool display_warning_if_disabled);
52 51
53 // Records query results and correctly formats them before sending them off 52 // Records query results and correctly formats them before sending them off
54 // to be displayed. Called when an Autofill query result is available. 53 // to be displayed. Called when an Autofill query result is available.
55 virtual void OnSuggestionsReturned( 54 virtual void OnSuggestionsReturned(
56 int query_id, 55 int query_id,
57 const std::vector<string16>& autofill_values, 56 const std::vector<string16>& autofill_values,
58 const std::vector<string16>& autofill_labels, 57 const std::vector<string16>& autofill_labels,
59 const std::vector<string16>& autofill_icons, 58 const std::vector<string16>& autofill_icons,
60 const std::vector<int>& autofill_unique_ids); 59 const std::vector<int>& autofill_unique_ids);
61 60
62 // Show password suggestions in the popup. 61 // Show password suggestions in the popup.
63 void OnShowPasswordSuggestions(const std::vector<string16>& suggestions, 62 void OnShowPasswordSuggestions(const std::vector<string16>& suggestions,
64 const webkit::forms::FormField& field, 63 const webkit::forms::FormField& field,
65 const gfx::Rect& bounds); 64 const gfx::Rect& bounds);
66 65
66 // Remove the given Autocomplete entry from the DB.
67 virtual void RemoveAutocompleteEntry(const string16& value);
68
69 // Remove the given Autofill profile or credit credit.
70 virtual void RemoveAutofillProfileOrCreditCard(int unique_id);
71
67 // Inform the delegate that the text field editing has ended, this is 72 // Inform the delegate that the text field editing has ended, this is
68 // used to help record the metrics of when a new popup is shown. 73 // used to help record the metrics of when a new popup is shown.
69 void DidEndTextFieldEditing(); 74 void DidEndTextFieldEditing();
70 75
71 // Inform the delegate that an autofill suggestion have been chosen. Returns 76 // Inform the delegate that an autofill suggestion have been chosen. Returns
72 // true if the suggestion was selected. 77 // true if the suggestion was selected.
73 bool DidAcceptAutofillSuggestions(const string16& value, 78 bool DidAcceptAutofillSuggestions(const string16& value,
74 int unique_id, 79 int unique_id,
75 unsigned index); 80 unsigned index);
76 81
(...skipping 22 matching lines...) Expand all
99 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper, 104 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper,
100 AutofillManager* autofill_manager); 105 AutofillManager* autofill_manager);
101 106
102 // Displays the the Autofill results to the user with an external 107 // Displays the the Autofill results to the user with an external
103 // Autofill popup that lives completely in the browser. The suggestions 108 // Autofill popup that lives completely in the browser. The suggestions
104 // have be correctly formatted by this point. 109 // have be correctly formatted by this point.
105 virtual void ApplyAutofillSuggestions( 110 virtual void ApplyAutofillSuggestions(
106 const std::vector<string16>& autofill_values, 111 const std::vector<string16>& autofill_values,
107 const std::vector<string16>& autofill_labels, 112 const std::vector<string16>& autofill_labels,
108 const std::vector<string16>& autofill_icons, 113 const std::vector<string16>& autofill_icons,
109 const std::vector<int>& autofill_unique_ids, 114 const std::vector<int>& autofill_unique_ids) = 0;
110 int separator_index) = 0;
111 115
112 // Handle instance specific OnQueryCode. 116 // Handle instance specific OnQueryCode.
113 virtual void OnQueryPlatformSpecific(int query_id, 117 virtual void OnQueryPlatformSpecific(int query_id,
114 const webkit::forms::FormData& form, 118 const webkit::forms::FormData& form,
115 const webkit::forms::FormField& field, 119 const webkit::forms::FormField& field,
116 const gfx::Rect& bounds) = 0; 120 const gfx::Rect& bounds) = 0;
117 121
118 // Handle platform-dependent hiding. 122 // Handle platform-dependent hiding.
119 virtual void HideAutofillPopupInternal() = 0; 123 virtual void HideAutofillPopupInternal() = 0;
120 124
(...skipping 21 matching lines...) Expand all
142 webkit::forms::FormData autofill_query_form_; 146 webkit::forms::FormData autofill_query_form_;
143 webkit::forms::FormField autofill_query_field_; 147 webkit::forms::FormField autofill_query_field_;
144 148
145 // Should we display a warning if Autofill is disabled? 149 // Should we display a warning if Autofill is disabled?
146 bool display_warning_if_disabled_; 150 bool display_warning_if_disabled_;
147 151
148 // Have we already shown Autofill suggestions for the field the user is 152 // Have we already shown Autofill suggestions for the field the user is
149 // currently editing? Used to keep track of state for metrics logging. 153 // currently editing? Used to keep track of state for metrics logging.
150 bool has_shown_autofill_popup_for_current_edit_; 154 bool has_shown_autofill_popup_for_current_edit_;
151 155
152 // The menu index of the "Clear" menu item.
153 int suggestions_clear_index_;
154
155 // The menu index of the "Autofill options..." menu item.
156 int suggestions_options_index_;
157
158 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); 156 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate);
159 }; 157 };
160 158
161 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ 159 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698