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

Unified Diff: chrome/browser/chromeos/power/power_prefs.cc

Issue 99133022: GetDefaultProfile fixit for Chrome OS network & power settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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();
« no previous file with comments | « chrome/browser/chromeos/power/peripheral_battery_observer.cc ('k') | chrome/browser/chromeos/sim_dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698