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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 200473002: Move all callers of GetHomeDir() to PathService::Get(base::DIR_HOME). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 9 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
Index: chrome/browser/chromeos/login/user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index 1e0c61a99c7b6f86d073c225b2b659bec3a8ab06..88d17f41c6a06a1df47ed1559ebfddbdd15dea5f 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -8,6 +8,7 @@
#include <set>
#include "ash/multi_profile_uma.h"
+#include "base/base_paths.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
@@ -16,6 +17,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "base/path_service.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
@@ -54,6 +56,7 @@
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/crash_keys.h"
#include "chrome/common/pref_names.h"
@@ -1504,12 +1507,21 @@ void UserManagerImpl::RetailModeUserLoggedIn() {
}
void UserManagerImpl::NotifyOnLogin() {
- UpdateNumberOfUsers();
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // Override user homedir.
+ if (GetLoggedInUsers().size() == 1) {
+ base::FilePath homedir = ProfileHelper::GetProfilePathByUserIdHash(
+ primary_user_->username_hash());
+ PathService::Override(base::DIR_HOME, homedir);
Will Drewry 2014/04/08 15:55:04 Does this mean the home dir will always be the fir
Nikita (slow) 2014/04/08 16:40:08 Correct. This is the way how it works today and ha
+ PathService::Override(chrome::DIR_USER_DATA, homedir);
+ }
+
+ UpdateNumberOfUsers();
NotifyActiveUserHashChanged(active_user_->username_hash());
NotifyActiveUserChanged(active_user_);
-
UpdateLoginState();
+
// TODO(nkostylev): Deprecate this notification in favor of
// ActiveUserChanged() observer call.
content::NotificationService::current()->Notify(

Powered by Google App Engine
This is Rietveld 408576698