| 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 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2216 } | 2216 } |
| 2217 | 2217 |
| 2218 void ProfileSyncService::RequestStop(SyncStopDataFate data_fate) { | 2218 void ProfileSyncService::RequestStop(SyncStopDataFate data_fate) { |
| 2219 DCHECK(thread_checker_.CalledOnValidThread()); | 2219 DCHECK(thread_checker_.CalledOnValidThread()); |
| 2220 sync_prefs_.SetSyncRequested(false); | 2220 sync_prefs_.SetSyncRequested(false); |
| 2221 StopImpl(data_fate); | 2221 StopImpl(data_fate); |
| 2222 } | 2222 } |
| 2223 | 2223 |
| 2224 bool ProfileSyncService::IsSyncRequested() const { | 2224 bool ProfileSyncService::IsSyncRequested() const { |
| 2225 DCHECK(thread_checker_.CalledOnValidThread()); | 2225 DCHECK(thread_checker_.CalledOnValidThread()); |
| 2226 return sync_prefs_.IsSyncRequested(); | 2226 // When local sync is on sync should be considered requsted or otherwise it |
| 2227 // will not resume after the policy or the flag has been removed. |
| 2228 return sync_prefs_.IsSyncRequested() || sync_prefs_.IsLocalSyncEnabled(); |
| 2227 } | 2229 } |
| 2228 | 2230 |
| 2229 SigninManagerBase* ProfileSyncService::signin() const { | 2231 SigninManagerBase* ProfileSyncService::signin() const { |
| 2230 DCHECK(thread_checker_.CalledOnValidThread()); | 2232 DCHECK(thread_checker_.CalledOnValidThread()); |
| 2231 if (!signin_) | 2233 if (!signin_) |
| 2232 return nullptr; | 2234 return nullptr; |
| 2233 return signin_->GetOriginal(); | 2235 return signin_->GetOriginal(); |
| 2234 } | 2236 } |
| 2235 | 2237 |
| 2236 void ProfileSyncService::RequestStart() { | 2238 void ProfileSyncService::RequestStart() { |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 return; | 2452 return; |
| 2451 | 2453 |
| 2452 DCHECK(startup_controller_->IsSetupInProgress()); | 2454 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2453 startup_controller_->SetSetupInProgress(false); | 2455 startup_controller_->SetSetupInProgress(false); |
| 2454 | 2456 |
| 2455 if (IsEngineInitialized()) | 2457 if (IsEngineInitialized()) |
| 2456 ReconfigureDatatypeManager(); | 2458 ReconfigureDatatypeManager(); |
| 2457 NotifyObservers(); | 2459 NotifyObservers(); |
| 2458 } | 2460 } |
| 2459 } // namespace browser_sync | 2461 } // namespace browser_sync |
| OLD | NEW |