Chromium Code Reviews| Index: chrome/browser/ui/views/autofill/autofill_external_delegate_views.h |
| diff --git a/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h b/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..700f05591a19557b8811fe648e8add5a90cdd030 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright (c) 2012 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_UI_VIEWS_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_VIEWS_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_VIEWS_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
|
tfarina
2012/09/02 12:08:04
unused here.
csharp
2012/09/05 17:28:52
Done.
|
| +#include "chrome/browser/autofill/autofill_external_delegate.h" |
| + |
| +class AutofillPopupViewViews; |
| + |
| +namespace content { |
| +class WebContents; |
|
tfarina
2012/09/02 12:08:04
unused here.
csharp
2012/09/05 17:28:52
Done.
|
| +} |
| + |
| +// The View specific implementations of the AutofillExternalDelegate, |
| +// handling the communication between the Autofill and Autocomplete |
| +// selection and the popup that shows the values. |
| +class AutofillExternalDelegateViews : public AutofillExternalDelegate { |
| + public: |
| + AutofillExternalDelegateViews(TabContents* tab_contents, |
|
tfarina
2012/09/02 12:08:04
did you mean WebContents?
csharp
2012/09/05 17:28:52
Nope, tabcontents is needed by the base external d
|
| + AutofillManager* autofill_manager); |
| + |
| + virtual ~AutofillExternalDelegateViews(); |
| + |
| + // Used by the popup view to indicate it has been destroyed. |
| + void InvalidateView(); |
| + |
| + protected: |
| + AutofillPopupViewViews* GetPopup() { return view_; } |
|
tfarina
2012/09/02 12:08:04
and then rename this to popup_view()?
csharp
2012/09/05 17:28:52
Done.
|
| + |
| + // AutofillExternalDelegate implementation. |
| + // Make protected to allow tests to override. |
| + virtual void HideAutofillPopupInternal() OVERRIDE; |
| + |
| + private: |
| + // AutofillExternalDelegate implementation. |
| + virtual void OnQueryPlatformSpecific( |
| + int query_id, |
| + const webkit::forms::FormData& form, |
| + const webkit::forms::FormField& field, |
| + const gfx::Rect& bounds) OVERRIDE; |
| + virtual void ApplyAutofillSuggestions( |
| + 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) OVERRIDE; |
| + virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
|
tfarina
2012/09/02 12:08:04
include compiler_specific.h for OVERRIDE.
csharp
2012/09/05 17:28:52
Done.
|
| + |
| + // Create a valid view to display the autofill results if one doesn't |
| + // currently exist. |
| + void CreateViewIfNeeded(); |
| + |
| + // We use a raw pointer here because even though we usually create the view, |
| + // its widget handles deleting it. |
| + AutofillPopupViewViews* view_; |
|
tfarina
2012/09/02 12:08:04
|view_| is too generic. How about popup_view_?
csharp
2012/09/05 17:28:52
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegateViews); |
|
tfarina
2012/09/02 12:08:04
include basictypes.h for this.
csharp
2012/09/05 17:28:52
Done.
|
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_VIEWS_H_ |