diff options
author | maxbogue <maxbogue@chromium.org> | 2015-06-11 15:08:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-11 22:09:10 +0000 |
commit | e8150cbd62e7c6b8289226e38e194cb8dbe229b3 (patch) | |
tree | 665f2d8643cedd7e66073ea6aadcccc5bc3a9e87 /components/sync_driver/sync_service.h | |
parent | 314fb90b02df6ab1d454351c581521f4e7ff14f0 (diff) | |
download | chromium_src-e8150cbd62e7c6b8289226e38e194cb8dbe229b3.zip chromium_src-e8150cbd62e7c6b8289226e38e194cb8dbe229b3.tar.gz chromium_src-e8150cbd62e7c6b8289226e38e194cb8dbe229b3.tar.bz2 |
[Sync] Add ProfileSyncService::IsSyncAllowed().
This is part of an effort to clean up sync's state interface. The new
IsSyncAllowed function is the canonical place to see whether there is
anything disallowing sync from starting up. This is conceptually
distinct from missing data (such as an auth token) required to start, or
from the user having turned sync off manually via RequestStop().
This CL also renames Profile::IsSyncAccessible to Profile::IsSyncAllowed
for consistent wording.
BUG=495192
TBR=finnur,mlerman,estade
Review URL: https://codereview.chromium.org/1173453003
Cr-Commit-Position: refs/heads/master@{#334049}
Diffstat (limited to 'components/sync_driver/sync_service.h')
-rw-r--r-- | components/sync_driver/sync_service.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/sync_driver/sync_service.h b/components/sync_driver/sync_service.h index 6719f48..476f1de 100644 --- a/components/sync_driver/sync_service.h +++ b/components/sync_driver/sync_service.h @@ -35,6 +35,11 @@ class SyncService : public sync_driver::DataTypeEncryptionHandler { // is actually running. virtual bool HasSyncSetupCompleted() const = 0; + // Whether sync is allowed to start. Command line flags, platform-level + // overrides, and account-level overrides are examples of reasons this + // might be false. + virtual bool IsSyncAllowed() const = 0; + // Returns true if sync is fully initialized and active. This implies that // an initial configuration has successfully completed, although there may // be datatype specific, auth, or other transient errors. To see which @@ -69,7 +74,7 @@ class SyncService : public sync_driver::DataTypeEncryptionHandler { // Virtual to enable mocking in tests. // TODO(tim): Remove this? Nothing in ProfileSyncService uses it, and outside // callers use a seemingly arbitrary / redundant / bug prone combination of - // this method, IsSyncAccessible, and others. + // this method, IsSyncAllowed, and others. virtual bool IsSyncEnabledAndLoggedIn() = 0; // Disables sync for user. Use ShowLoginDialog to enable. |