| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/webdata_services/web_data_service_wrapper.h" | 5 #include "components/webdata_services/web_data_service_wrapper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 const base::FilePath& context_path, | 40 const base::FilePath& context_path, |
| 41 const std::string& app_locale, | 41 const std::string& app_locale, |
| 42 autofill::AutofillWebDataBackend* autofill_backend) { | 42 autofill::AutofillWebDataBackend* autofill_backend) { |
| 43 DCHECK(db_thread->BelongsToCurrentThread()); | 43 DCHECK(db_thread->BelongsToCurrentThread()); |
| 44 | 44 |
| 45 // Currently only Autocomplete and Autofill profiles use the new Sync API, but | 45 // Currently only Autocomplete and Autofill profiles use the new Sync API, but |
| 46 // all the database data should migrate to this API over time. | 46 // all the database data should migrate to this API over time. |
| 47 if (base::FeatureList::IsEnabled(switches::kSyncUSSAutocomplete)) { | 47 if (base::FeatureList::IsEnabled(switches::kSyncUSSAutocomplete)) { |
| 48 autofill::AutocompleteSyncBridge::CreateForWebDataServiceAndBackend( | 48 autofill::AutocompleteSyncBridge::CreateForWebDataServiceAndBackend( |
| 49 autofill_web_data.get(), autofill_backend); | 49 autofill_web_data.get(), autofill_backend); |
| 50 autofill::AutocompleteSyncBridge::FromWebDataService( |
| 51 autofill_web_data.get()) |
| 52 ->InjectStartSyncFlare(sync_flare); |
| 50 } else { | 53 } else { |
| 51 autofill::AutocompleteSyncableService::CreateForWebDataServiceAndBackend( | 54 autofill::AutocompleteSyncableService::CreateForWebDataServiceAndBackend( |
| 52 autofill_web_data.get(), autofill_backend); | 55 autofill_web_data.get(), autofill_backend); |
| 53 autofill::AutocompleteSyncableService::FromWebDataService( | 56 autofill::AutocompleteSyncableService::FromWebDataService( |
| 54 autofill_web_data.get()) | 57 autofill_web_data.get()) |
| 55 ->InjectStartSyncFlare(sync_flare); | 58 ->InjectStartSyncFlare(sync_flare); |
| 56 } | 59 } |
| 57 | 60 |
| 58 autofill::AutofillProfileSyncableService::CreateForWebDataServiceAndBackend( | 61 autofill::AutofillProfileSyncableService::CreateForWebDataServiceAndBackend( |
| 59 autofill_web_data.get(), autofill_backend, app_locale); | 62 autofill_web_data.get(), autofill_backend, app_locale); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { | 153 scoped_refptr<TokenWebData> WebDataServiceWrapper::GetTokenWebData() { |
| 151 return token_web_data_.get(); | 154 return token_web_data_.get(); |
| 152 } | 155 } |
| 153 | 156 |
| 154 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
| 155 scoped_refptr<PasswordWebDataService> | 158 scoped_refptr<PasswordWebDataService> |
| 156 WebDataServiceWrapper::GetPasswordWebData() { | 159 WebDataServiceWrapper::GetPasswordWebData() { |
| 157 return password_web_data_.get(); | 160 return password_web_data_.get(); |
| 158 } | 161 } |
| 159 #endif | 162 #endif |
| OLD | NEW |