| Index: chrome/browser/ui/webui/sync_setup_handler.cc
|
| diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
|
| index 219a5e9d649e6280a084c84f59bfe0144eaa5b4b..45190ee1d2252b1e11f719b911e7d30d5a094e99 100644
|
| --- a/chrome/browser/ui/webui/sync_setup_handler.cc
|
| +++ b/chrome/browser/ui/webui/sync_setup_handler.cc
|
| @@ -946,8 +946,12 @@ Profile* SyncSetupHandler::GetProfile() const {
|
|
|
| ProfileSyncService* SyncSetupHandler::GetSyncService() const {
|
| Profile* profile = GetProfile();
|
| - return profile->IsSyncAccessible() ?
|
| - ProfileSyncServiceFactory::GetForProfile(GetProfile()) : NULL;
|
| + ProfileSyncService* service = NULL;
|
| + if (profile->IsSyncAccessible())
|
| + service = ProfileSyncServiceFactory::GetForProfile(GetProfile());
|
| + if (service->IsManaged())
|
| + service = NULL;
|
| + return service;
|
| }
|
|
|
| void SyncSetupHandler::SigninSuccess() {
|
| @@ -1147,8 +1151,8 @@ void SyncSetupHandler::CloseSyncSetup() {
|
| if (IsActiveLogin()) {
|
| // Don't log a cancel event if the sync setup dialog is being
|
| // automatically closed due to an auth error.
|
| - if ((!sync_service || !sync_service->HasSyncSetupCompleted()) &&
|
| - sync_service->GetAuthError().state() == GoogleServiceAuthError::NONE) {
|
| + if (!sync_service || (!sync_service->HasSyncSetupCompleted() &&
|
| + sync_service->GetAuthError().state() == GoogleServiceAuthError::NONE)) {
|
| if (signin_tracker_.get()) {
|
| ProfileSyncService::SyncEvent(
|
| ProfileSyncService::CANCEL_DURING_SIGNON);
|
|
|