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_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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "chrome/browser/autofill/autofill_popup_delegate.h" | |
13 #include "chrome/browser/autofill/password_autofill_manager.h" | 12 #include "chrome/browser/autofill/password_autofill_manager.h" |
13 #include "chrome/browser/ui/autofill/autofill_popup_delegate.h" | |
14 #include "chrome/common/form_data.h" | 14 #include "chrome/common/form_data.h" |
15 #include "chrome/common/form_field_data.h" | 15 #include "chrome/common/form_field_data.h" |
16 #include "chrome/common/password_form_fill_data.h" | 16 #include "chrome/common/password_form_fill_data.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 #include "content/public/browser/web_contents_user_data.h" | 19 #include "content/public/browser/web_contents_user_data.h" |
20 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
21 | 21 |
22 class AutofillManager; | 22 class AutofillManager; |
23 class AutofillPopupControllerImpl; | 23 class AutofillPopupControllerImpl; |
(...skipping 16 matching lines...) Expand all Loading... | |
40 public content::NotificationObserver, | 40 public content::NotificationObserver, |
41 public AutofillPopupDelegate { | 41 public AutofillPopupDelegate { |
42 public: | 42 public: |
43 // Creates an AutofillExternalDelegate and attaches it to the specified | 43 // Creates an AutofillExternalDelegate and attaches it to the specified |
44 // contents; the second argument is an AutofillManager managing Autofill for | 44 // contents; the second argument is an AutofillManager managing Autofill for |
45 // that WebContents. | 45 // that WebContents. |
46 static void CreateForWebContentsAndManager(content::WebContents* web_contents, | 46 static void CreateForWebContentsAndManager(content::WebContents* web_contents, |
47 AutofillManager* autofill_manager); | 47 AutofillManager* autofill_manager); |
48 | 48 |
49 // AutofillPopupDelegate implementation. | 49 // AutofillPopupDelegate implementation. |
50 virtual void SelectAutofillSuggestionAtIndex(int unique_id) OVERRIDE; | 50 virtual void DidSelectSuggestion(int identifier) OVERRIDE; |
51 virtual bool DidAcceptAutofillSuggestion(const string16& value, | 51 virtual void DidAcceptSuggestion(const string16& value, |
52 int unique_id, | 52 int identifier) OVERRIDE; |
Ilya Sherman
2012/12/20 21:57:42
nit: Alignment
Evan Stade
2012/12/20 23:04:00
Done.
| |
53 unsigned index) OVERRIDE; | 53 virtual void RemoveSuggestion(int identifier) OVERRIDE; |
54 virtual void RemoveAutocompleteEntry(const string16& value) OVERRIDE; | |
Ilya Sherman
2012/12/20 21:57:42
Let's combine these two methods into a single meth
Evan Stade
2012/12/20 23:04:00
Done.
| |
54 virtual void ClearPreviewedForm() OVERRIDE; | 55 virtual void ClearPreviewedForm() OVERRIDE; |
55 virtual void RemoveAutocompleteEntry(const string16& value) OVERRIDE; | |
56 virtual void RemoveAutofillProfileOrCreditCard(int unique_id) OVERRIDE; | |
57 virtual void ControllerDestroyed() OVERRIDE; | 56 virtual void ControllerDestroyed() OVERRIDE; |
58 | 57 |
59 // Records and associates a query_id with web form data. Called | 58 // Records and associates a query_id with web form data. Called |
60 // when the renderer posts an Autofill query to the browser. |bounds| | 59 // when the renderer posts an Autofill query to the browser. |bounds| |
61 // is window relative. |display_warning_if_disabled| tells us if we should | 60 // is window relative. |display_warning_if_disabled| tells us if we should |
62 // display warnings (such as autofill is disabled, but had suggestions). | 61 // display warnings (such as autofill is disabled, but had suggestions). |
63 // We might not want to display the warning if a website has disabled | 62 // We might not want to display the warning if a website has disabled |
64 // Autocomplete because they have their own popup, and showing our popup | 63 // Autocomplete because they have their own popup, and showing our popup |
65 // on to of theirs would be a poor user experience. | 64 // on to of theirs would be a poor user experience. |
66 virtual void OnQuery(int query_id, | 65 virtual void OnQuery(int query_id, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 // The current data list values. | 188 // The current data list values. |
190 std::vector<string16> data_list_values_; | 189 std::vector<string16> data_list_values_; |
191 std::vector<string16> data_list_labels_; | 190 std::vector<string16> data_list_labels_; |
192 std::vector<string16> data_list_icons_; | 191 std::vector<string16> data_list_icons_; |
193 std::vector<int> data_list_unique_ids_; | 192 std::vector<int> data_list_unique_ids_; |
194 | 193 |
195 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); | 194 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); |
196 }; | 195 }; |
197 | 196 |
198 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 197 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
OLD | NEW |