Chromium Code Reviews| Index: chrome/browser/autofill/autofill_external_delegate.cc |
| diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..457f86dfca472febe8da76c86b1dbe61ed198c40 |
| --- /dev/null |
| +++ b/chrome/browser/autofill/autofill_external_delegate.cc |
| @@ -0,0 +1,37 @@ |
| +// 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. |
| + |
| +#include "chrome/browser/autofill/autofill_external_delegate.h" |
| +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| +#include "chrome/common/autofill_messages.h" |
| +#include "content/browser/renderer_host/render_view_host.h" |
| + |
| +AutofillExternalDelegate::~AutofillExternalDelegate() { |
| +} |
| + |
| +AutofillExternalDelegate::AutofillExternalDelegate( |
| + TabContentsWrapper* tab_contents_wrapper) |
| + : tab_contents_wrapper_(tab_contents_wrapper) { |
| +} |
| + |
| +void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int listIndex) { |
| + RenderViewHost* host = tab_contents_wrapper_->render_view_host(); |
|
Ilya Sherman
2011/10/27 11:01:55
nit: How about just storing the RenderViewHost as
John Grabowski
2011/10/27 17:42:21
discussed offline
|
| + host->Send(new AutofillMsg_SelectAutofillSuggestionAtIndex( |
| + host->routing_id(), |
| + listIndex)); |
| +} |
| + |
| + |
| +// Add a "!defined(OS_YOUROS) for each platform that implements this |
| +// in an autofill_external_delegate_YOUROS.cc. Currently there are |
| +// none, so all platforms use the default. |
| + |
| +#if !defined(OS_ANDROID) |
| + |
| +AutofillExternalDelegate* AutofillExternalDelegate::Create( |
| + TabContentsWrapper*, AutofillManager*) { |
| + return NULL; |
| +} |
| + |
| +#endif |