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

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: 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 da473e4540cc2246f0b555ceeb573a97581237ae..08c4edd9e5774b5235f9e09acae42499fab4f074 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -125,7 +125,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,
@@ -674,6 +675,7 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) {
weak_factory_.InvalidateWeakPtrs();
// Clear various flags.
+ start_up_time_ = base::Time();
Andrew T Wilson (Slow) 2013/05/13 11:51:13 Why is this here?
pavely 2013/05/13 22:37:09 PSS::StartUp checks that start_up_time_ is null. I
expect_sync_configuration_aborted_ = false;
is_auth_in_progress_ = false;
backend_initialized_ = false;
@@ -1167,6 +1169,12 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) {
case syncer::DISABLE_SYNC_ON_CLIENT:
OnStopSyncingPermanently();
break;
+ case syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT:
+ // Sync disabled by domain admin. we should stop syncing until
+ // user signs out and signs in again.
Andrew T Wilson (Slow) 2013/05/13 11:51:13 We need to handle situations where the user cannot
+ sync_prefs_.SetSyncDisabledByAdmin(true);
+ DisableForUser();
+ break;
default:
NOTREACHED();
}
@@ -1923,7 +1931,9 @@ void ProfileSyncService::Observe(int type,
break;
}
case chrome::NOTIFICATION_GOOGLE_SIGNED_OUT:
- // Disable sync if the user is signed out.
+ // Disable sync if the user is signed out. Clear DisabledByAdmin flag so
+ // when next time user signs in sync can try to connect to server again.
+ sync_prefs_.SetSyncDisabledByAdmin(false);
DisableForUser();
break;
default: {
@@ -1960,7 +1970,7 @@ bool ProfileSyncService::IsSyncEnabled() {
}
bool ProfileSyncService::IsManaged() const {
- return sync_prefs_.IsManaged();
+ return sync_prefs_.IsManaged() || sync_prefs_.IsSyncDisabledByAdmin();
}
bool ProfileSyncService::ShouldPushChanges() {

Powered by Google App Engine
This is Rietveld 408576698