OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | |
7 #pragma once | |
8 | |
9 #include <vector> | |
10 | |
11 #include "base/string16.h" | |
12 | |
13 class AutofillManager; | |
14 class TabContentsWrapper; | |
15 | |
16 namespace webkit_glue { | |
17 struct FormData; | |
18 struct FormField; | |
19 } // namespace webkit_glue | |
20 | |
21 // Delegate for external processing of autocomplete and autofill | |
22 // display and selection. | |
Ilya Sherman
2011/10/27 11:01:55
nit: For consistency with the style in adjacent fi
John Grabowski
2011/10/27 17:42:21
Done (throughout)
| |
23 class AutofillExternalDelegate { | |
24 public: | |
25 virtual ~AutofillExternalDelegate(); | |
26 | |
27 // When using an external autofill delegate. Allows Chrome to tell | |
28 // WebKit which autofill selection has been chosen. | |
29 void SelectAutofillSuggestionAtIndex(int listIndex); | |
Ilya Sherman
2011/10/27 11:01:55
nit: Should this perhaps be protected? Where is t
Ilya Sherman
2011/10/27 11:01:55
Also, Autofill has two selection-like states, whic
John Grabowski
2011/10/27 17:42:21
This method would be invoked by the platform-speci
John Grabowski
2011/10/27 17:42:21
My platform does not have hover capacity. This is
Ilya Sherman
2011/10/27 21:17:24
Ok. Please add a TODO here just as a reminder for
| |
30 | |
31 // Records and associates a query_id with web form data. Called | |
32 // when the renderer posts an autofill query to the browser. | |
33 virtual void OnQuery(int query_id, | |
34 const webkit_glue::FormData& form, | |
35 const webkit_glue::FormField& field) = 0; | |
36 | |
37 // Records query results. Displays them to the user with an external | |
38 // autofill popup that lives completely in the browser. Called when | |
39 // an autofill query result is available. | |
40 virtual void OnSuggestionsReturned( | |
41 int query_id, | |
42 const std::vector<string16>& autofill_values, | |
43 const std::vector<string16>& autofill_labels, | |
44 const std::vector<string16>& autofill_icons, | |
45 const std::vector<int>& autofill_unique_ids) = 0; | |
46 | |
47 // Platforms that wish to implement an external autofill delegate | |
48 // MUST implement this. The 1st arg is the tab contents that owns | |
49 // this delegate; the second is the autofill manager owned by the | |
50 // tab contents. | |
51 static AutofillExternalDelegate* Create(TabContentsWrapper*, | |
52 AutofillManager*); | |
53 | |
54 protected: | |
55 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper); | |
56 | |
57 private: | |
58 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); | |
61 }; | |
62 | |
63 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | |
OLD | NEW |