| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_version_info.h" | 10 #include "chrome/app/chrome_version_info.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 options.http_bridge_factory, | 392 options.http_bridge_factory, |
| 393 options.auth_http_bridge_factory, | 393 options.auth_http_bridge_factory, |
| 394 host_, // ModelSafeWorkerRegistrar. | 394 host_, // ModelSafeWorkerRegistrar. |
| 395 options.attempt_last_user_authentication, | 395 options.attempt_last_user_authentication, |
| 396 options.invalidate_sync_login, | 396 options.invalidate_sync_login, |
| 397 options.invalidate_sync_xmpp_login, | 397 options.invalidate_sync_xmpp_login, |
| 398 MakeUserAgentForSyncapi().c_str(), | 398 MakeUserAgentForSyncapi().c_str(), |
| 399 options.lsid.c_str(), | 399 options.lsid.c_str(), |
| 400 options.notification_method); | 400 options.notification_method); |
| 401 DCHECK(success) << "Syncapi initialization failed!"; | 401 DCHECK(success) << "Syncapi initialization failed!"; |
| 402 |
| 403 // TODO(dantasse): this call is in a temporary position in order to enable |
| 404 // the new sync setup/passphrase UI. http://crbug.com/45869 |
| 405 DoStartSyncing(); |
| 402 } | 406 } |
| 403 | 407 |
| 404 void SyncBackendHost::Core::DoAuthenticate(const std::string& username, | 408 void SyncBackendHost::Core::DoAuthenticate(const std::string& username, |
| 405 const std::string& password, | 409 const std::string& password, |
| 406 const std::string& captcha) { | 410 const std::string& captcha) { |
| 407 DCHECK(MessageLoop::current() == host_->core_thread_.message_loop()); | 411 DCHECK(MessageLoop::current() == host_->core_thread_.message_loop()); |
| 408 syncapi_->Authenticate(username.c_str(), password.c_str(), captcha.c_str()); | 412 syncapi_->Authenticate(username.c_str(), password.c_str(), captcha.c_str()); |
| 409 } | 413 } |
| 410 | 414 |
| 411 void SyncBackendHost::Core::DoStartSyncing() { | 415 void SyncBackendHost::Core::DoStartSyncing() { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 609 } |
| 606 | 610 |
| 607 void SyncBackendHost::Core::DeleteSyncDataFolder() { | 611 void SyncBackendHost::Core::DeleteSyncDataFolder() { |
| 608 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { | 612 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { |
| 609 if (!file_util::Delete(host_->sync_data_folder_path(), true)) | 613 if (!file_util::Delete(host_->sync_data_folder_path(), true)) |
| 610 LOG(DFATAL) << "Could not delete the Sync Data folder."; | 614 LOG(DFATAL) << "Could not delete the Sync Data folder."; |
| 611 } | 615 } |
| 612 } | 616 } |
| 613 | 617 |
| 614 } // namespace browser_sync | 618 } // namespace browser_sync |
| OLD | NEW |