Chromium Code Reviews| 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 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" | |
| 6 | |
| 7 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h" | |
| 8 | |
| 9 AutofillExternalDelegate* AutofillExternalDelegate::Create( | |
| 10 TabContents* tab_contents, | |
| 11 AutofillManager* autofill_manager) { | |
| 12 return new AutofillExternalDelegateViews(tab_contents, | |
| 13 autofill_manager); | |
|
Ilya Sherman
2012/08/14 05:12:09
nit: This looks like it fits on the previous line.
csharp
2012/08/14 19:06:13
Done.
| |
| 14 } | |
| 15 | |
| 16 AutofillExternalDelegateViews::AutofillExternalDelegateViews( | |
| 17 TabContents* tab_contents, | |
| 18 AutofillManager* autofill_manager) | |
| 19 : AutofillExternalDelegate(tab_contents, autofill_manager), | |
| 20 web_contents_(tab_contents->web_contents()) { | |
| 21 } | |
| 22 | |
| 23 AutofillExternalDelegateViews::~AutofillExternalDelegateViews() { | |
| 24 } | |
| 25 | |
| 26 void AutofillExternalDelegateViews::HideAutofillPopupInternal() { | |
| 27 if (!view_.get()) | |
| 28 return; | |
| 29 | |
| 30 view_->Hide(); | |
| 31 | |
|
Ilya Sherman
2012/08/14 05:12:09
Optional nit: I would omit this blank line, but up
csharp
2012/08/14 19:06:13
Done.
| |
| 32 view_.reset(); | |
| 33 } | |
| 34 | |
| 35 void AutofillExternalDelegateViews::OnQueryPlatformSpecific( | |
| 36 int query_id, | |
| 37 const webkit::forms::FormData& form, | |
| 38 const webkit::forms::FormField& field, | |
| 39 const gfx::Rect& bounds) { | |
| 40 CreateViewIfNeeded(); | |
| 41 | |
|
Ilya Sherman
2012/08/14 05:12:09
nit: Ditto
csharp
2012/08/14 19:06:13
Done.
| |
| 42 view_->set_element_bounds(bounds); | |
| 43 } | |
| 44 | |
| 45 void AutofillExternalDelegateViews::ApplyAutofillSuggestions( | |
| 46 const std::vector<string16>& autofill_values, | |
| 47 const std::vector<string16>& autofill_labels, | |
| 48 const std::vector<string16>& autofill_icons, | |
| 49 const std::vector<int>& autofill_unique_ids) { | |
| 50 CreateViewIfNeeded(); | |
| 51 | |
| 52 view_->Show(autofill_values, | |
| 53 autofill_labels, | |
| 54 autofill_icons, | |
| 55 autofill_unique_ids); | |
| 56 } | |
| 57 | |
| 58 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) { | |
| 59 view_->SetBoundsRect(bounds); | |
| 60 } | |
| 61 | |
| 62 void AutofillExternalDelegateViews::CreateViewIfNeeded() { | |
| 63 if (view_.get()) | |
|
Ilya Sherman
2012/08/14 05:12:09
Optional nit: This method would be slightly shorte
csharp
2012/08/14 19:06:13
Done.
| |
| 64 return; | |
| 65 | |
| 66 view_.reset(new AutofillPopupViewViews(web_contents_, this)); | |
| 67 } | |
| OLD | NEW |