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/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 TestPersonalDataManager() : PersonalDataManager("en-US") { | 80 TestPersonalDataManager() : PersonalDataManager("en-US") { |
81 CreateTestAutofillProfiles(&web_profiles_); | 81 CreateTestAutofillProfiles(&web_profiles_); |
82 CreateTestCreditCards(&credit_cards_); | 82 CreateTestCreditCards(&credit_cards_); |
83 } | 83 } |
84 | 84 |
85 void SetBrowserContext(content::BrowserContext* context) { | 85 void SetBrowserContext(content::BrowserContext* context) { |
86 set_browser_context(context); | 86 set_browser_context(context); |
87 } | 87 } |
88 | 88 |
89 // Factory method for keyed service. PersonalDataManager is NULL for testing. | 89 // Factory method for keyed service. PersonalDataManager is NULL for testing. |
90 static ProfileKeyedService* Build(content::BrowserContext* profile) { | 90 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { |
91 return NULL; | 91 return NULL; |
92 } | 92 } |
93 | 93 |
94 MOCK_METHOD1(SaveImportedProfile, void(const AutofillProfile&)); | 94 MOCK_METHOD1(SaveImportedProfile, void(const AutofillProfile&)); |
95 | 95 |
96 AutofillProfile* GetProfileWithGUID(const char* guid) { | 96 AutofillProfile* GetProfileWithGUID(const char* guid) { |
97 for (std::vector<AutofillProfile *>::iterator it = web_profiles_.begin(); | 97 for (std::vector<AutofillProfile *>::iterator it = web_profiles_.begin(); |
98 it != web_profiles_.end(); ++it) { | 98 it != web_profiles_.end(); ++it) { |
99 if (!(*it)->guid().compare(guid)) | 99 if (!(*it)->guid().compare(guid)) |
100 return *it; | 100 return *it; |
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3210 CreateTestAddressFormData(&form); | 3210 CreateTestAddressFormData(&form); |
3211 std::vector<FormData> forms(1, form); | 3211 std::vector<FormData> forms(1, form); |
3212 FormsSeen(forms); | 3212 FormsSeen(forms); |
3213 const FormFieldData& field = form.fields[0]; | 3213 const FormFieldData& field = form.fields[0]; |
3214 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3214 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3215 | 3215 |
3216 autofill_manager_->SetExternalDelegate(NULL); | 3216 autofill_manager_->SetExternalDelegate(NULL); |
3217 } | 3217 } |
3218 | 3218 |
3219 } // namespace autofill | 3219 } // namespace autofill |
OLD | NEW |