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..f33673088679bc3ee726748d7cabc0d10e367d21 |
| --- /dev/null |
| +++ b/chrome/browser/autofill/autofill_external_delegate.h |
| @@ -0,0 +1,52 @@ |
| +// 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. |
| +class AutofillExternalDelegate { |
| + public: |
| + |
| + virtual ~AutofillExternalDelegate(); |
|
Ilya Sherman
2011/10/26 11:09:58
nit: Should the constructor for this class be prot
|
| + |
| + // 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. Display them to the user with an external |
|
Ilya Sherman
2011/10/26 11:09:58
nit: "Display" -> "Displays"?
|
| + // 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*, |
|
dhollowa
2011/10/26 16:14:22
nit: this may be non-trivial, so title-case is mor
|
| + AutofillManager*); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_H_ |