| 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 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 void ProfileSyncService::SyncEvent(SyncEventCodes code) { | 419 void ProfileSyncService::SyncEvent(SyncEventCodes code) { |
| 420 static LinearHistogram histogram("Sync.EventCodes", MIN_SYNC_EVENT_CODE, | 420 static LinearHistogram histogram("Sync.EventCodes", MIN_SYNC_EVENT_CODE, |
| 421 MAX_SYNC_EVENT_CODE - 1, | 421 MAX_SYNC_EVENT_CODE - 1, |
| 422 MAX_SYNC_EVENT_CODE); | 422 MAX_SYNC_EVENT_CODE); |
| 423 histogram.SetFlags(kUmaTargetedHistogramFlag); | 423 histogram.SetFlags(kUmaTargetedHistogramFlag); |
| 424 histogram.Add(code); | 424 histogram.Add(code); |
| 425 } | 425 } |
| 426 | 426 |
| 427 bool ProfileSyncService::IsSyncEnabled() { | 427 bool ProfileSyncService::IsSyncEnabled() { |
| 428 #if defined(OS_POSIX) | 428 // We have switches::kEnableSync just in case we need to change back to |
| 429 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableSync); | 429 // sync-disabled-by-default on a platform. |
| 430 #else | |
| 431 return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync); | 430 return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync); |
| 432 #endif | |
| 433 } | 431 } |
| 434 | 432 |
| 435 bool ProfileSyncService::ShouldPushChanges() { | 433 bool ProfileSyncService::ShouldPushChanges() { |
| 436 // True only after all bootstrapping has succeeded: the bookmark model is | 434 // True only after all bootstrapping has succeeded: the bookmark model is |
| 437 // loaded, the sync backend is initialized, the two domains are | 435 // loaded, the sync backend is initialized, the two domains are |
| 438 // consistent with one another, and no unrecoverable error has transpired. | 436 // consistent with one another, and no unrecoverable error has transpired. |
| 439 return change_processor_->IsRunning(); | 437 return change_processor_->IsRunning(); |
| 440 } | 438 } |
| OLD | NEW |