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/webdata/web_data_service_factory.h" | 5 #include "chrome/browser/webdata/web_data_service_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void InitSyncableServicesOnDBThread( | 43 void InitSyncableServicesOnDBThread( |
44 scoped_refptr<AutofillWebDataService> autofill_web_data, | 44 scoped_refptr<AutofillWebDataService> autofill_web_data, |
45 const base::FilePath& profile_path, | 45 const base::FilePath& profile_path, |
46 const std::string& app_locale, | 46 const std::string& app_locale, |
47 autofill::AutofillWebDataBackend* autofill_backend) { | 47 autofill::AutofillWebDataBackend* autofill_backend) { |
48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
49 | 49 |
50 // Currently only Autocomplete and Autofill profiles use the new Sync API, but | 50 // Currently only Autocomplete and Autofill profiles use the new Sync API, but |
51 // all the database data should migrate to this API over time. | 51 // all the database data should migrate to this API over time. |
52 AutocompleteSyncableService::CreateForWebDataServiceAndBackend( | 52 AutocompleteSyncableService::CreateForWebDataServiceAndBackend( |
53 autofill_web_data, autofill_backend); | 53 autofill_web_data.get(), autofill_backend); |
54 AutocompleteSyncableService::FromWebDataService( | 54 AutocompleteSyncableService::FromWebDataService(autofill_web_data.get()) |
55 autofill_web_data)->InjectStartSyncFlare( | 55 ->InjectStartSyncFlare( |
56 sync_start_util::GetFlareForSyncableService(profile_path)); | 56 sync_start_util::GetFlareForSyncableService(profile_path)); |
57 AutofillProfileSyncableService::CreateForWebDataServiceAndBackend( | 57 AutofillProfileSyncableService::CreateForWebDataServiceAndBackend( |
58 autofill_web_data, autofill_backend, app_locale); | 58 autofill_web_data.get(), autofill_backend, app_locale); |
59 AutofillProfileSyncableService::FromWebDataService( | 59 AutofillProfileSyncableService::FromWebDataService(autofill_web_data.get()) |
60 autofill_web_data)->InjectStartSyncFlare( | 60 ->InjectStartSyncFlare( |
61 sync_start_util::GetFlareForSyncableService(profile_path)); | 61 sync_start_util::GetFlareForSyncableService(profile_path)); |
62 } | 62 } |
63 | 63 |
64 } // namespace | 64 } // namespace |
65 | 65 |
66 WebDataServiceWrapper::WebDataServiceWrapper() {} | 66 WebDataServiceWrapper::WebDataServiceWrapper() {} |
67 | 67 |
68 WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { | 68 WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) { |
69 base::FilePath profile_path = profile->GetPath(); | 69 base::FilePath profile_path = profile->GetPath(); |
70 base::FilePath path = profile_path.Append(kWebDataFilename); | 70 base::FilePath path = profile_path.Append(kWebDataFilename); |
71 | 71 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 223 } |
224 | 224 |
225 BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( | 225 BrowserContextKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( |
226 content::BrowserContext* profile) const { | 226 content::BrowserContext* profile) const { |
227 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); | 227 return new WebDataServiceWrapper(static_cast<Profile*>(profile)); |
228 } | 228 } |
229 | 229 |
230 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { | 230 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { |
231 return true; | 231 return true; |
232 } | 232 } |
OLD | NEW |