Chromium Code Reviews| Index: chrome/browser/autofill/autofill_external_delegate.h |
| diff --git a/chrome/browser/autofill/autofill_external_delegate.h b/chrome/browser/autofill/autofill_external_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f536714cce84fd3fda2117fdabdfe23d49d56d5f |
| --- /dev/null |
| +++ b/chrome/browser/autofill/autofill_external_delegate.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
| +#define CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |
| +#pragma once |
| + |
| +#include <vector> |
| + |
| +#include "base/string16.h" |
| + |
| +class AutofillManager; |
| +class TabContentsWrapper; |
| + |
| +namespace webkit_glue { |
| +struct FormData; |
| +struct FormField; |
| +} // namespace webkit_glue |
| + |
| +// Delegate for external processing of autocomplete and autofill |
| +// 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)
|
| +class AutofillExternalDelegate { |
| + public: |
| + virtual ~AutofillExternalDelegate(); |
| + |
| + // When using an external autofill delegate. Allows Chrome to tell |
| + // WebKit which autofill selection has been chosen. |
| + 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
|
| + |
| + // Records and associates a query_id with web form data. Called |
| + // when the renderer posts an autofill query to the browser. |
| + virtual void OnQuery(int query_id, |
| + const webkit_glue::FormData& form, |
| + const webkit_glue::FormField& field) = 0; |
| + |
| + // Records query results. Displays them to the user with an external |
| + // autofill popup that lives completely in the browser. Called when |
| + // an autofill query result is available. |
| + virtual void OnSuggestionsReturned( |
| + int query_id, |
| + const std::vector<string16>& autofill_values, |
| + const std::vector<string16>& autofill_labels, |
| + const std::vector<string16>& autofill_icons, |
| + const std::vector<int>& autofill_unique_ids) = 0; |
| + |
| + // Platforms that wish to implement an external autofill delegate |
| + // MUST implement this. The 1st arg is the tab contents that owns |
| + // this delegate; the second is the autofill manager owned by the |
| + // tab contents. |
| + static AutofillExternalDelegate* Create(TabContentsWrapper*, |
| + AutofillManager*); |
| + |
| + protected: |
| + explicit AutofillExternalDelegate(TabContentsWrapper* tab_contents_wrapper); |
| + |
| + private: |
| + TabContentsWrapper* tab_contents_wrapper_; // weak; owns me. |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegate); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |