| 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/autofill/test_autofill_external_delegate.h" | 5 #include "chrome/browser/autofill/test_autofill_external_delegate.h" |
| 6 | 6 |
| 7 #include "ui/gfx/rect.h" | 7 #include "ui/gfx/rect.h" |
| 8 | 8 |
| 9 namespace autofill { | 9 namespace autofill { |
| 10 | 10 |
| 11 void GenerateTestAutofillPopup( | 11 void GenerateTestAutofillPopup( |
| 12 AutofillExternalDelegate* autofill_external_delegate) { | 12 AutofillExternalDelegate* autofill_external_delegate) { |
| 13 int query_id = 1; | 13 int query_id = 1; |
| 14 FormData form; | 14 FormData form; |
| 15 FormFieldData field; | 15 FormFieldData field; |
| 16 field.is_focusable = true; | 16 field.is_focusable = true; |
| 17 field.should_autocomplete = true; | 17 field.should_autocomplete = true; |
| 18 gfx::Rect bounds(100, 100); | 18 gfx::RectF bounds(100.f, 100.f); |
| 19 autofill_external_delegate->OnQuery(query_id, form, field, bounds, false); | 19 autofill_external_delegate->OnQuery(query_id, form, field, bounds, false); |
| 20 | 20 |
| 21 std::vector<string16> autofill_item; | 21 std::vector<string16> autofill_item; |
| 22 autofill_item.push_back(string16()); | 22 autofill_item.push_back(string16()); |
| 23 std::vector<int> autofill_id; | 23 std::vector<int> autofill_id; |
| 24 autofill_id.push_back(0); | 24 autofill_id.push_back(0); |
| 25 autofill_external_delegate->OnSuggestionsReturned( | 25 autofill_external_delegate->OnSuggestionsReturned( |
| 26 query_id, autofill_item, autofill_item, autofill_item, autofill_id); | 26 query_id, autofill_item, autofill_item, autofill_item, autofill_id); |
| 27 } | 27 } |
| 28 | 28 |
| 29 TestAutofillExternalDelegate::TestAutofillExternalDelegate( | 29 TestAutofillExternalDelegate::TestAutofillExternalDelegate( |
| 30 content::WebContents* web_contents, | 30 content::WebContents* web_contents, |
| 31 AutofillManager* autofill_manager) | 31 AutofillManager* autofill_manager) |
| 32 : AutofillExternalDelegate(web_contents, autofill_manager) { | 32 : AutofillExternalDelegate(web_contents, autofill_manager) { |
| 33 // Initialize Controller. | 33 // Initialize Controller. |
| 34 const gfx::Rect element_bounds; | 34 const gfx::RectF element_bounds; |
| 35 AutofillExternalDelegate::EnsurePopupForElement(element_bounds); | 35 AutofillExternalDelegate::EnsurePopupForElement(element_bounds); |
| 36 } | 36 } |
| 37 | 37 |
| 38 TestAutofillExternalDelegate::~TestAutofillExternalDelegate() {} | 38 TestAutofillExternalDelegate::~TestAutofillExternalDelegate() {} |
| 39 | 39 |
| 40 void TestAutofillExternalDelegate::ApplyAutofillSuggestions( | 40 void TestAutofillExternalDelegate::ApplyAutofillSuggestions( |
| 41 const std::vector<string16>& autofill_values, | 41 const std::vector<string16>& autofill_values, |
| 42 const std::vector<string16>& autofill_labels, | 42 const std::vector<string16>& autofill_labels, |
| 43 const std::vector<string16>& autofill_icons, | 43 const std::vector<string16>& autofill_icons, |
| 44 const std::vector<int>& autofill_unique_ids) {} | 44 const std::vector<int>& autofill_unique_ids) {} |
| 45 | 45 |
| 46 void TestAutofillExternalDelegate::HideAutofillPopup() {} | 46 void TestAutofillExternalDelegate::HideAutofillPopup() {} |
| 47 | 47 |
| 48 void TestAutofillExternalDelegate::EnsurePopupForElement( | 48 void TestAutofillExternalDelegate::EnsurePopupForElement( |
| 49 const gfx::Rect& element_bounds) {} | 49 const gfx::RectF& element_bounds) {} |
| 50 | 50 |
| 51 void TestAutofillExternalDelegate::ControllerDestroyed() {} | 51 void TestAutofillExternalDelegate::ControllerDestroyed() {} |
| 52 | 52 |
| 53 } // namespace autofill | 53 } // namespace autofill |
| OLD | NEW |