Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4011)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 14655009: Client changes for disabled dasher account (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 68a76cbf4bc1cedbc9f70c048670ddd0ffc9f154..f1746cdc9a7df84773d8970bd26d85ce2dfb7bea 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -127,7 +127,8 @@ static bool IsTokenServiceRelevant(const std::string& service) {
bool ShouldShowActionOnUI(
const syncer::SyncProtocolError& error) {
return (error.action != syncer::UNKNOWN_ACTION &&
- error.action != syncer::DISABLE_SYNC_ON_CLIENT);
+ error.action != syncer::DISABLE_SYNC_ON_CLIENT &&
+ error.action != syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT);
}
ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory,
@@ -145,6 +146,7 @@ ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory,
data_type_requested_sync_startup_(false),
is_first_time_sync_configure_(false),
backend_initialized_(false),
+ sync_disabled_by_admin_(false),
is_auth_in_progress_(false),
signin_(signin_manager),
unrecoverable_error_reason_(ERROR_REASON_UNSET),
@@ -1219,6 +1221,12 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) {
// TODO(rsimha): Re-evaluate whether to also sign out the user here after
// a dashboard clear. See http://crbug.com/240436.
break;
+ case syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT:
+ // Sync disabled by domain admin. we should stop syncing until next
+ // restart
Andrew T Wilson (Slow) 2013/05/24 15:13:10 nit: sentence punctuation (add a period at the end
pavely 2013/05/24 22:17:11 Done.
+ sync_disabled_by_admin_ = true;
+ ShutdownImpl(true);
+ break;
default:
NOTREACHED();
}
@@ -1975,7 +1983,6 @@ void ProfileSyncService::Observe(int type,
break;
}
case chrome::NOTIFICATION_GOOGLE_SIGNED_OUT:
- // Disable sync if the user is signed out.
DisableForUser();
break;
default: {
@@ -2012,7 +2019,7 @@ bool ProfileSyncService::IsSyncEnabled() {
}
bool ProfileSyncService::IsManaged() const {
- return sync_prefs_.IsManaged();
+ return sync_prefs_.IsManaged() || sync_disabled_by_admin_;
Andrew T Wilson (Slow) 2013/05/24 15:13:10 I'm OK with this change even though it means we no
}
bool ProfileSyncService::ShouldPushChanges() {

Powered by Google App Engine
This is Rietveld 408576698