summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:08:30 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:08:30 +0000
commitddf8a4b03ca007cc55ead2000aa6b54d0319cd56 (patch)
treeaa003d9d9267aaf96bdcdddc121d1a768724e56d /chrome/browser/browser_main.cc
parent9a5ed1bb31b06504a4baf190ad7f87cf5d703653 (diff)
downloadchromium_src-ddf8a4b03ca007cc55ead2000aa6b54d0319cd56.zip
chromium_src-ddf8a4b03ca007cc55ead2000aa6b54d0319cd56.tar.gz
chromium_src-ddf8a4b03ca007cc55ead2000aa6b54d0319cd56.tar.bz2
We had a problem where if chrome crashed on cros and was relaunched
it would always run with the Default profile. This meant that two different users could see the same data...a big problem. We patched in the OS by deleting the profile directory each time but this is the right fix. When the session_manager reruns Chrome on a crash it will now pass a new flag (--login-user). Chrome uses this and ensures that the profile dir (specified by --login-profile) is mounted as an encrypted drive. If this flag isn't specified then Chrome uses the Default profile, but in incognito mode so no data is written. BUG=chromiumos:1967 TEST=Login to chromeos as user1, in a terminal kill the browser process, chrome relaunches, log into gmail, sign out (using menu or power button). Login as user2, kill browser process, chrome relaunches, go to gmail. Ensure that user1 isn't logged in. Review URL: http://codereview.chromium.org/1094009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 0971b4a..6941bae 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -132,6 +132,7 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/external_metrics.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/views/browser_dialogs.h"
#endif
@@ -755,6 +756,15 @@ int BrowserMain(const MainFunctionParams& parameters) {
// Try to create/load the profile.
ProfileManager* profile_manager = browser_process->profile_manager();
+#if defined(OS_CHROMEOS)
+ if (parsed_command_line.HasSwitch(switches::kLoginUser)) {
+ std::string username =
+ parsed_command_line.GetSwitchValueASCII(switches::kLoginUser);
+ LOG(INFO) << "Relaunching browser for user: " << username;
+ chromeos::UserManager::Get()->UserLoggedIn(username);
+ }
+#endif
+
Profile* profile = profile_manager->GetDefaultProfile(user_data_dir);
#if defined(OS_WIN)