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; |
} |