OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h" | 7 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h" |
8 | 8 |
9 AutofillExternalDelegate* AutofillExternalDelegate::Create( | 9 AutofillExternalDelegate* AutofillExternalDelegate::Create( |
10 TabContents* tab_contents, | 10 TabContents* tab_contents, |
(...skipping 21 matching lines...) Expand all Loading... |
32 void AutofillExternalDelegateViews::HideAutofillPopupInternal() { | 32 void AutofillExternalDelegateViews::HideAutofillPopupInternal() { |
33 if (!popup_view_) | 33 if (!popup_view_) |
34 return; | 34 return; |
35 | 35 |
36 popup_view_->Hide(); | 36 popup_view_->Hide(); |
37 popup_view_ = NULL; | 37 popup_view_ = NULL; |
38 } | 38 } |
39 | 39 |
40 void AutofillExternalDelegateViews::OnQueryPlatformSpecific( | 40 void AutofillExternalDelegateViews::OnQueryPlatformSpecific( |
41 int query_id, | 41 int query_id, |
42 const webkit::forms::FormData& form, | 42 const FormData& form, |
43 const webkit::forms::FormField& field, | 43 const FormFieldData& field, |
44 const gfx::Rect& bounds) { | 44 const gfx::Rect& bounds) { |
45 CreateViewIfNeeded(); | 45 CreateViewIfNeeded(); |
46 popup_view_->set_element_bounds(bounds); | 46 popup_view_->set_element_bounds(bounds); |
47 } | 47 } |
48 | 48 |
49 void AutofillExternalDelegateViews::ApplyAutofillSuggestions( | 49 void AutofillExternalDelegateViews::ApplyAutofillSuggestions( |
50 const std::vector<string16>& autofill_values, | 50 const std::vector<string16>& autofill_values, |
51 const std::vector<string16>& autofill_labels, | 51 const std::vector<string16>& autofill_labels, |
52 const std::vector<string16>& autofill_icons, | 52 const std::vector<string16>& autofill_icons, |
53 const std::vector<int>& autofill_unique_ids) { | 53 const std::vector<int>& autofill_unique_ids) { |
54 CreateViewIfNeeded(); | 54 CreateViewIfNeeded(); |
55 | 55 |
56 popup_view_->Show(autofill_values, | 56 popup_view_->Show(autofill_values, |
57 autofill_labels, | 57 autofill_labels, |
58 autofill_icons, | 58 autofill_icons, |
59 autofill_unique_ids); | 59 autofill_unique_ids); |
60 } | 60 } |
61 | 61 |
62 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) { | 62 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) { |
63 popup_view_->SetBoundsRect(bounds); | 63 popup_view_->SetBoundsRect(bounds); |
64 } | 64 } |
65 | 65 |
66 void AutofillExternalDelegateViews::CreateViewIfNeeded() { | 66 void AutofillExternalDelegateViews::CreateViewIfNeeded() { |
67 if (!popup_view_) | 67 if (!popup_view_) |
68 popup_view_ = new AutofillPopupViewViews(web_contents(), this); | 68 popup_view_ = new AutofillPopupViewViews(web_contents(), this); |
69 } | 69 } |
OLD | NEW |