summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 17:23:43 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-12 17:23:43 +0000
commiteec3bcfa9e92a62fef68293ccbef32b6ef98eea7 (patch)
tree0935285f90235f0303659055197f179fb5d7c23b /chrome/browser/sync
parentfc701137f192ee798ee6d9a41cf11fcb34d218bb (diff)
downloadchromium_src-eec3bcfa9e92a62fef68293ccbef32b6ef98eea7.zip
chromium_src-eec3bcfa9e92a62fef68293ccbef32b6ef98eea7.tar.gz
chromium_src-eec3bcfa9e92a62fef68293ccbef32b6ef98eea7.tar.bz2
Turn on sync for OS X (behind an --enable-sync switch).
Added ProfileSyncService::IsSyncEnabled(). BUG=23073 TEST=manually (OS X),trybot Review URL: http://codereview.chromium.org/389019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/profile_sync_service.cc8
-rw-r--r--chrome/browser/sync/profile_sync_service.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index d8a6b00..953ebd3 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -423,6 +423,14 @@ void ProfileSyncService::SyncEvent(SyncEventCodes code) {
histogram.Add(code);
}
+bool ProfileSyncService::IsSyncEnabled() {
+#if defined(OS_POSIX)
+ return CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableSync);
+#else
+ return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync);
+#endif
+}
+
bool ProfileSyncService::ShouldPushChanges() {
// True only after all bootstrapping has succeeded: the bookmark model is
// loaded, the sync backend is initialized, the two domains are
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 6730226..a738311 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -195,6 +195,11 @@ class ProfileSyncService : public NotificationObserver,
// Record stats on various events.
static void SyncEvent(SyncEventCodes code);
+ // Returns whether sync is enabled. Sync can be enabled/disabled both
+ // at compile time (e.g., on a per-OS basis) or at run time (e.g.,
+ // command-line switches).
+ static bool IsSyncEnabled();
+
// UnrecoverableErrorHandler implementation.
virtual void OnUnrecoverableError();