| 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/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 data_type_manager_.get() && | 946 data_type_manager_.get() && |
| 947 data_type_manager_->state() != DataTypeManager::CONFIGURED) { | 947 data_type_manager_->state() != DataTypeManager::CONFIGURED) { |
| 948 return "Datatypes not fully initialized"; | 948 return "Datatypes not fully initialized"; |
| 949 } else if (ShouldPushChanges()) { | 949 } else if (ShouldPushChanges()) { |
| 950 return "Sync service initialized"; | 950 return "Sync service initialized"; |
| 951 } else { | 951 } else { |
| 952 return "Status unknown: Internal error?"; | 952 return "Status unknown: Internal error?"; |
| 953 } | 953 } |
| 954 } | 954 } |
| 955 | 955 |
| 956 SyncBackendHost::Status ProfileSyncService::QueryDetailedSyncStatus() { | 956 bool ProfileSyncService::QueryDetailedSyncStatus( |
| 957 SyncBackendHost::Status* result) { |
| 957 if (backend_.get() && backend_initialized_) { | 958 if (backend_.get() && backend_initialized_) { |
| 958 return backend_->GetDetailedStatus(); | 959 *result = backend_->GetDetailedStatus(); |
| 960 return true; |
| 959 } else { | 961 } else { |
| 960 SyncBackendHost::Status status; | 962 SyncBackendHost::Status status; |
| 961 status.sync_protocol_error = last_actionable_error_; | 963 status.sync_protocol_error = last_actionable_error_; |
| 962 return status; | 964 *result = status; |
| 965 return false; |
| 963 } | 966 } |
| 964 } | 967 } |
| 965 | 968 |
| 966 const GoogleServiceAuthError& ProfileSyncService::GetAuthError() const { | 969 const GoogleServiceAuthError& ProfileSyncService::GetAuthError() const { |
| 967 return last_auth_error_; | 970 return last_auth_error_; |
| 968 } | 971 } |
| 969 | 972 |
| 970 bool ProfileSyncService::FirstSetupInProgress() const { | 973 bool ProfileSyncService::FirstSetupInProgress() const { |
| 971 return !HasSyncSetupCompleted() && setup_in_progress_; | 974 return !HasSyncSetupCompleted() && setup_in_progress_; |
| 972 } | 975 } |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1725 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
| 1723 ProfileSyncService* old_this = this; | 1726 ProfileSyncService* old_this = this; |
| 1724 this->~ProfileSyncService(); | 1727 this->~ProfileSyncService(); |
| 1725 new(old_this) ProfileSyncService( | 1728 new(old_this) ProfileSyncService( |
| 1726 new ProfileSyncComponentsFactoryImpl(profile, | 1729 new ProfileSyncComponentsFactoryImpl(profile, |
| 1727 CommandLine::ForCurrentProcess()), | 1730 CommandLine::ForCurrentProcess()), |
| 1728 profile, | 1731 profile, |
| 1729 signin, | 1732 signin, |
| 1730 behavior); | 1733 behavior); |
| 1731 } | 1734 } |
| OLD | NEW |