| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifdef CHROME_PERSONALIZATION | 5 #ifdef CHROME_PERSONALIZATION |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 // Make sure that the directory exists before initializing the backend. | 185 // Make sure that the directory exists before initializing the backend. |
| 186 // If it already exists, this will do no harm. | 186 // If it already exists, this will do no harm. |
| 187 bool success = file_util::CreateDirectory(host_->sync_data_folder_path()); | 187 bool success = file_util::CreateDirectory(host_->sync_data_folder_path()); |
| 188 DCHECK(success); | 188 DCHECK(success); |
| 189 | 189 |
| 190 syncapi_->SetObserver(this); | 190 syncapi_->SetObserver(this); |
| 191 string16 path_str; | 191 string16 path_str; |
| 192 #if defined (OS_WIN) | 192 #if defined (OS_WIN) |
| 193 path_str = host_->sync_data_folder_path().value(); | 193 path_str = host_->sync_data_folder_path().value(); |
| 194 #elif (defined(OS_LINUX) || defined(OS_MACOSX)) | 194 #elif defined(OS_LINUX) || defined(OS_MACOSX) |
| 195 path_str = UTF8ToUTF16(host_->sync_data_folder_path().value()); | 195 path_str = UTF8ToUTF16(host_->sync_data_folder_path().value()); |
| 196 #endif | 196 #endif |
| 197 success = syncapi_->Init(path_str.c_str(), | 197 success = syncapi_->Init(path_str.c_str(), |
| 198 (service_url.host() + service_url.path()).c_str(), | 198 (service_url.host() + service_url.path()).c_str(), |
| 199 service_url.EffectiveIntPort(), | 199 service_url.EffectiveIntPort(), |
| 200 kGaiaServiceId, | 200 kGaiaServiceId, |
| 201 kGaiaSourceForChrome, | 201 kGaiaSourceForChrome, |
| 202 service_url.SchemeIsSecure(), | 202 service_url.SchemeIsSecure(), |
| 203 new HttpBridgeFactory(base_request_context_), | 203 new HttpBridgeFactory(base_request_context_), |
| 204 new HttpBridgeFactory(base_request_context_), | 204 new HttpBridgeFactory(base_request_context_), |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 this, &Core::SaveChanges); | 320 this, &Core::SaveChanges); |
| 321 } | 321 } |
| 322 | 322 |
| 323 void SyncBackendHost::Core::SaveChanges() { | 323 void SyncBackendHost::Core::SaveChanges() { |
| 324 syncapi_->SaveChanges(); | 324 syncapi_->SaveChanges(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace browser_sync | 327 } // namespace browser_sync |
| 328 | 328 |
| 329 #endif | 329 #endif |
| OLD | NEW |