| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_VIEWS_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
| 11 |
| 12 class AutofillPopupViewViews; |
| 13 |
| 14 // The View specific implementations of the AutofillExternalDelegate, |
| 15 // handling the communication between the Autofill and Autocomplete |
| 16 // selection and the popup that shows the values. |
| 17 class AutofillExternalDelegateViews : public AutofillExternalDelegate { |
| 18 public: |
| 19 AutofillExternalDelegateViews(TabContents* tab_contents, |
| 20 AutofillManager* autofill_manager); |
| 21 |
| 22 virtual ~AutofillExternalDelegateViews(); |
| 23 |
| 24 // Used by the popup view to indicate it has been destroyed. |
| 25 void InvalidateView(); |
| 26 |
| 27 protected: |
| 28 AutofillPopupViewViews* popup_view() { return popup_view_; } |
| 29 |
| 30 // AutofillExternalDelegate implementation. |
| 31 // Make protected to allow tests to override. |
| 32 virtual void HideAutofillPopupInternal() OVERRIDE; |
| 33 |
| 34 private: |
| 35 // AutofillExternalDelegate implementation. |
| 36 virtual void OnQueryPlatformSpecific( |
| 37 int query_id, |
| 38 const webkit::forms::FormData& form, |
| 39 const webkit::forms::FormField& field, |
| 40 const gfx::Rect& bounds) OVERRIDE; |
| 41 virtual void ApplyAutofillSuggestions( |
| 42 const std::vector<string16>& autofill_values, |
| 43 const std::vector<string16>& autofill_labels, |
| 44 const std::vector<string16>& autofill_icons, |
| 45 const std::vector<int>& autofill_unique_ids) OVERRIDE; |
| 46 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
| 47 |
| 48 // Create a valid view to display the autofill results if one doesn't |
| 49 // currently exist. |
| 50 void CreateViewIfNeeded(); |
| 51 |
| 52 // We use a raw pointer here because even though we usually create the view, |
| 53 // its widget handles deleting it. |
| 54 AutofillPopupViewViews* popup_view_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegateViews); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_EXTERNAL_DELEGATE_VIEWS_H_ |
| OLD | NEW |