OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 | 12 |
13 class AutofillManager; | 13 class AutofillManager; |
14 class TabContentsWrapper; | 14 class TabContentsWrapper; |
15 | 15 |
16 namespace gfx { | |
17 class Rect; | |
18 } | |
19 | |
16 namespace webkit_glue { | 20 namespace webkit_glue { |
17 struct FormData; | 21 struct FormData; |
18 struct FormField; | 22 struct FormField; |
19 } // namespace webkit_glue | 23 } // namespace webkit_glue |
20 | 24 |
21 // Delegate for external processing of Autocomplete and Autofill | 25 // Delegate for external processing of Autocomplete and Autofill |
22 // display and selection. | 26 // display and selection. |
23 class AutofillExternalDelegate { | 27 class AutofillExternalDelegate { |
24 public: | 28 public: |
25 virtual ~AutofillExternalDelegate(); | 29 virtual ~AutofillExternalDelegate(); |
(...skipping 12 matching lines...) Expand all Loading... | |
38 // Records query results. Displays them to the user with an external | 42 // Records query results. Displays them to the user with an external |
39 // Autofill popup that lives completely in the browser. Called when | 43 // Autofill popup that lives completely in the browser. Called when |
40 // an Autofill query result is available. | 44 // an Autofill query result is available. |
41 virtual void OnSuggestionsReturned( | 45 virtual void OnSuggestionsReturned( |
42 int query_id, | 46 int query_id, |
43 const std::vector<string16>& autofill_values, | 47 const std::vector<string16>& autofill_values, |
44 const std::vector<string16>& autofill_labels, | 48 const std::vector<string16>& autofill_labels, |
45 const std::vector<string16>& autofill_icons, | 49 const std::vector<string16>& autofill_icons, |
46 const std::vector<int>& autofill_unique_ids) = 0; | 50 const std::vector<int>& autofill_unique_ids) = 0; |
47 | 51 |
52 // Set the bounds of the element we are providing the Autofill data | |
John Grabowski
2011/11/08 20:46:02
Be more specific. E.g. state clearly this is the
csharp
2011/11/09 16:18:37
Done.
| |
53 // for. | |
54 virtual void SetAutofillElementBounds(const gfx::Rect& bounds) = 0; | |
55 | |
56 // Show the Autofill popup. | |
57 virtual void ShowAutofillPopup() = 0; | |
John Grabowski
2011/11/08 20:46:02
HideAutofillPopup() seems fine since it should be
csharp
2011/11/09 16:18:37
True, I had removed the Webkit call to it already
| |
58 | |
59 // Hide the Autofill poup. | |
60 virtual void HideAutofillPopup() = 0; | |
61 | |
48 // Platforms that wish to implement an external Autofill delegate | 62 // Platforms that wish to implement an external Autofill delegate |
49 // MUST implement this. The 1st arg is the tab contents that owns | 63 // MUST implement this. The 1st arg is the tab contents that owns |
50 // this delegate; the second is the Autofill manager owned by the | 64 // this delegate; the second is the Autofill manager owned by the |
51 // tab contents. | 65 // tab contents. |
52 static AutofillExternalDelegate* Create(TabContentsWrapper*, | 66 static AutofillExternalDelegate* Create(TabContentsWrapper*, |
53 AutofillManager*); | 67 AutofillManager*); |
54 | 68 |
55 protected: | 69 protected: |
56 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper); | 70 explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper); |
57 | 71 |
58 private: | 72 private: |
59 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. | 73 TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. |
60 | 74 |
61 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); | 75 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); |
62 }; | 76 }; |
63 | 77 |
64 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ | 78 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
OLD | NEW |