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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 460383002: Only deactivate SupervisedUserService when removing its delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index a5cae02584aa041052631496eb6c15b6e5630bdd..706997eb75e6a38c57c9fd1fad49f8b33c92b3cc 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -198,11 +198,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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698