| 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 "components/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 StopImpl(data_fate); | 2187 StopImpl(data_fate); |
| 2188 } | 2188 } |
| 2189 | 2189 |
| 2190 bool ProfileSyncService::IsSyncRequested() const { | 2190 bool ProfileSyncService::IsSyncRequested() const { |
| 2191 DCHECK(thread_checker_.CalledOnValidThread()); | 2191 DCHECK(thread_checker_.CalledOnValidThread()); |
| 2192 // When local sync is on sync should be considered requsted or otherwise it | 2192 // When local sync is on sync should be considered requsted or otherwise it |
| 2193 // will not resume after the policy or the flag has been removed. | 2193 // will not resume after the policy or the flag has been removed. |
| 2194 return sync_prefs_.IsSyncRequested() || sync_prefs_.IsLocalSyncEnabled(); | 2194 return sync_prefs_.IsSyncRequested() || sync_prefs_.IsLocalSyncEnabled(); |
| 2195 } | 2195 } |
| 2196 | 2196 |
| 2197 SigninManagerBase* ProfileSyncService::signin() const { | |
| 2198 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 2199 if (!signin_) | |
| 2200 return nullptr; | |
| 2201 return signin_->GetOriginal(); | |
| 2202 } | |
| 2203 | |
| 2204 void ProfileSyncService::RequestStart() { | 2197 void ProfileSyncService::RequestStart() { |
| 2205 DCHECK(thread_checker_.CalledOnValidThread()); | 2198 DCHECK(thread_checker_.CalledOnValidThread()); |
| 2206 if (!IsSyncAllowed()) { | 2199 if (!IsSyncAllowed()) { |
| 2207 // Sync cannot be requested if it's not allowed. | 2200 // Sync cannot be requested if it's not allowed. |
| 2208 return; | 2201 return; |
| 2209 } | 2202 } |
| 2210 DCHECK(sync_client_); | 2203 DCHECK(sync_client_); |
| 2211 if (!IsSyncRequested()) { | 2204 if (!IsSyncRequested()) { |
| 2212 sync_prefs_.SetSyncRequested(true); | 2205 sync_prefs_.SetSyncRequested(true); |
| 2213 NotifyObservers(); | 2206 NotifyObservers(); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 return; | 2411 return; |
| 2419 | 2412 |
| 2420 DCHECK(startup_controller_->IsSetupInProgress()); | 2413 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2421 startup_controller_->SetSetupInProgress(false); | 2414 startup_controller_->SetSetupInProgress(false); |
| 2422 | 2415 |
| 2423 if (IsEngineInitialized()) | 2416 if (IsEngineInitialized()) |
| 2424 ReconfigureDatatypeManager(); | 2417 ReconfigureDatatypeManager(); |
| 2425 NotifyObservers(); | 2418 NotifyObservers(); |
| 2426 } | 2419 } |
| 2427 } // namespace browser_sync | 2420 } // namespace browser_sync |
| OLD | NEW |