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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const int kDefaultPageID = 137; | 64 const int kDefaultPageID = 137; |
65 | 65 |
66 typedef Tuple5<int, | 66 typedef Tuple5<int, |
67 std::vector<string16>, | 67 std::vector<string16>, |
68 std::vector<string16>, | 68 std::vector<string16>, |
69 std::vector<string16>, | 69 std::vector<string16>, |
70 std::vector<int> > AutofillParam; | 70 std::vector<int> > AutofillParam; |
71 | 71 |
72 class TestPersonalDataManager : public PersonalDataManager { | 72 class TestPersonalDataManager : public PersonalDataManager { |
73 public: | 73 public: |
74 TestPersonalDataManager() { | 74 TestPersonalDataManager() : PersonalDataManager("en-US") { |
75 CreateTestAutofillProfiles(&web_profiles_); | 75 CreateTestAutofillProfiles(&web_profiles_); |
76 CreateTestCreditCards(&credit_cards_); | 76 CreateTestCreditCards(&credit_cards_); |
77 } | 77 } |
78 | 78 |
79 void SetBrowserContext(content::BrowserContext* context) { | 79 void SetBrowserContext(content::BrowserContext* context) { |
80 set_browser_context(context); | 80 set_browser_context(context); |
81 } | 81 } |
82 | 82 |
83 // Factory method for keyed service. PersonalDataManager is NULL for testing. | 83 // Factory method for keyed service. PersonalDataManager is NULL for testing. |
84 static ProfileKeyedService* Build(Profile* profile) { | 84 static ProfileKeyedService* Build(Profile* profile) { |
(...skipping 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3340 | 3340 |
3341 FormData form; | 3341 FormData form; |
3342 CreateTestAddressFormData(&form); | 3342 CreateTestAddressFormData(&form); |
3343 std::vector<FormData> forms(1, form); | 3343 std::vector<FormData> forms(1, form); |
3344 FormsSeen(forms); | 3344 FormsSeen(forms); |
3345 const FormFieldData& field = form.fields[0]; | 3345 const FormFieldData& field = form.fields[0]; |
3346 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3346 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3347 | 3347 |
3348 autofill_manager_->SetExternalDelegate(NULL); | 3348 autofill_manager_->SetExternalDelegate(NULL); |
3349 } | 3349 } |
OLD | NEW |