Commit 49607ff4 authored by bauerb@chromium.org's avatar bauerb@chromium.org

Only deactivate SupervisedUserService when removing its delegate.

BUG=372381

Review URL: https://codereview.chromium.org/460383002

Cr-Commit-Position: refs/heads/master@{#289002}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289002 0039d316-1c4b-4281-b951-d872f2087c98
parent 9569178b
......@@ -214,11 +214,14 @@ void SupervisedUserService::RegisterProfilePrefs(
}
void SupervisedUserService::SetDelegate(Delegate* delegate) {
if (delegate_ == delegate)
return;
// If the delegate changed, deactivate first to give the old delegate a chance
// to clean up.
SetActive(false);
if (delegate) {
// Changing delegates isn't allowed.
DCHECK(!delegate_);
} else {
// If the delegate is removed, deactivate first to give the old delegate a
// chance to clean up.
SetActive(false);
}
delegate_ = delegate;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment