| Index: chrome/browser/chromeos/power/power_prefs.cc
|
| diff --git a/chrome/browser/chromeos/power/power_prefs.cc b/chrome/browser/chromeos/power/power_prefs.cc
|
| index 805e802bf8081ef70636fac5ca762bc180872d3e..c44ffa7946bb0d98bcb61b1ce45cc61e27b999e9 100644
|
| --- a/chrome/browser/chromeos/power/power_prefs.cc
|
| +++ b/chrome/browser/chromeos/power/power_prefs.cc
|
| @@ -84,7 +84,7 @@ void PowerPrefs::Observe(int type,
|
| }
|
| case chrome::NOTIFICATION_SESSION_STARTED:
|
| // Update |profile_| when entering a session.
|
| - SetProfile(ProfileManager::GetDefaultProfile());
|
| + SetProfile(ProfileManager::GetPrimaryUserProfile());
|
| break;
|
| case chrome::NOTIFICATION_PROFILE_DESTROYED: {
|
| // Update |profile_| when exiting a session or shutting down.
|
| @@ -229,6 +229,11 @@ void PowerPrefs::RegisterProfilePrefs(
|
| }
|
|
|
| void PowerPrefs::SetProfile(Profile* profile) {
|
| + // No need to reapply policy if profile hasn't changed, e.g. when adding a
|
| + // secondary user to an existing session.
|
| + if (profile == profile_)
|
| + return;
|
| +
|
| profile_ = profile;
|
| pref_change_registrar_.reset();
|
|
|
|
|