Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: chrome/browser/sync/test/integration/autofill_helper.cc

Issue 72613006: Eliminate AutofillWebDataService::FromBrowserContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to reviews Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/sync/test/integration/autofill_helper.h" 5 #include "chrome/browser/sync/test/integration/autofill_helper.h"
6 6
7 #include "chrome/browser/autofill/personal_data_manager_factory.h" 7 #include "chrome/browser/autofill/personal_data_manager_factory.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sync/profile_sync_service.h" 10 #include "chrome/browser/sync/profile_sync_service.h"
11 #include "chrome/browser/sync/profile_sync_test_util.h" 11 #include "chrome/browser/sync/profile_sync_test_util.h"
12 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" 12 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
13 #include "chrome/browser/sync/test/integration/sync_test.h" 13 #include "chrome/browser/sync/test/integration/sync_test.h"
14 #include "chrome/browser/webdata/web_data_service_factory.h"
14 #include "components/autofill/core/browser/autofill_profile.h" 15 #include "components/autofill/core/browser/autofill_profile.h"
15 #include "components/autofill/core/browser/autofill_test_utils.h" 16 #include "components/autofill/core/browser/autofill_test_utils.h"
16 #include "components/autofill/core/browser/autofill_type.h" 17 #include "components/autofill/core/browser/autofill_type.h"
17 #include "components/autofill/core/browser/personal_data_manager.h" 18 #include "components/autofill/core/browser/personal_data_manager.h"
18 #include "components/autofill/core/browser/personal_data_manager_observer.h" 19 #include "components/autofill/core/browser/personal_data_manager_observer.h"
19 #include "components/autofill/core/browser/webdata/autofill_entry.h" 20 #include "components/autofill/core/browser/webdata/autofill_entry.h"
20 #include "components/autofill/core/browser/webdata/autofill_table.h" 21 #include "components/autofill/core/browser/webdata/autofill_table.h"
21 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 22 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
22 #include "components/autofill/core/common/form_field_data.h" 23 #include "components/autofill/core/common/form_field_data.h"
23 #include "components/webdata/common/web_database.h" 24 #include "components/webdata/common/web_database.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 case PROFILE_NULL: 158 case PROFILE_NULL:
158 autofill::test::SetProfileInfoWithGuid(&profile, 159 autofill::test::SetProfileInfoWithGuid(&profile,
159 "FE461507-7E13-4198-8E66-74C7DB6D8322", 160 "FE461507-7E13-4198-8E66-74C7DB6D8322",
160 "", "", "", "", "", "", "", "", "", "", "", ""); 161 "", "", "", "", "", "", "", "", "", "", "", "");
161 break; 162 break;
162 } 163 }
163 return profile; 164 return profile;
164 } 165 }
165 166
166 scoped_refptr<AutofillWebDataService> GetWebDataService(int index) { 167 scoped_refptr<AutofillWebDataService> GetWebDataService(int index) {
167 return AutofillWebDataService::FromBrowserContext(test()->GetProfile(index)); 168 return WebDataServiceFactory::GetAutofillWebDataForProfile(
169 test()->GetProfile(index), Profile::EXPLICIT_ACCESS);
168 } 170 }
169 171
170 PersonalDataManager* GetPersonalDataManager(int index) { 172 PersonalDataManager* GetPersonalDataManager(int index) {
171 return autofill::PersonalDataManagerFactory::GetForProfile( 173 return autofill::PersonalDataManagerFactory::GetForProfile(
172 test()->GetProfile(index)); 174 test()->GetProfile(index));
173 } 175 }
174 176
175 void AddKeys(int profile, const std::set<AutofillKey>& keys) { 177 void AddKeys(int profile, const std::set<AutofillKey>& keys) {
176 std::vector<FormFieldData> form_fields; 178 std::vector<FormFieldData> form_fields;
177 for (std::set<AutofillKey>::const_iterator i = keys.begin(); 179 for (std::set<AutofillKey>::const_iterator i = keys.begin();
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 if (!ProfilesMatch(0, i)) { 352 if (!ProfilesMatch(0, i)) {
351 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " 353 LOG(ERROR) << "Profile " << i << "does not contain the same autofill "
352 "profiles as profile 0."; 354 "profiles as profile 0.";
353 return false; 355 return false;
354 } 356 }
355 } 357 }
356 return true; 358 return true;
357 } 359 }
358 360
359 } // namespace autofill_helper 361 } // namespace autofill_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698