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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 594163002: Restore last used user session after crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: special case in ChromeUserManagerImpl Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 } 813 }
814 } 814 }
815 815
816 void ProfileManager::Observe( 816 void ProfileManager::Observe(
817 int type, 817 int type,
818 const content::NotificationSource& source, 818 const content::NotificationSource& source,
819 const content::NotificationDetails& details) { 819 const content::NotificationDetails& details) {
820 #if defined(OS_CHROMEOS) 820 #if defined(OS_CHROMEOS)
821 if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) { 821 if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) {
822 logged_in_ = true; 822 logged_in_ = true;
823 // Find out what the current user is and update it. This has only to be done
824 // when the profile was already loaded, since otherwise this will be set by
825 // the profile loading process.
826 user_manager::UserManager* manager = user_manager::UserManager::Get();
827 const user_manager::User* user = manager->GetActiveUser();
828 if (user && user->is_profile_created()) {
829 UpdateLastUser(
830 chromeos::ProfileHelper::Get()->GetProfileByUser(user));
831 }
832 823
833 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 824 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
834 if (!command_line.HasSwitch(switches::kTestType)) { 825 if (!command_line.HasSwitch(switches::kTestType)) {
835 // If we don't have a mounted profile directory we're in trouble. 826 // If we don't have a mounted profile directory we're in trouble.
836 // TODO(davemoore) Once we have better api this check should ensure that 827 // TODO(davemoore) Once we have better api this check should ensure that
837 // our profile directory is the one that's mounted, and that it's mounted 828 // our profile directory is the one that's mounted, and that it's mounted
838 // as the current user. 829 // as the current user.
839 chromeos::DBusThreadManager::Get()->GetCryptohomeClient()->IsMounted( 830 chromeos::DBusThreadManager::Get()->GetCryptohomeClient()->IsMounted(
840 base::Bind(&CheckCryptohomeIsMounted)); 831 base::Bind(&CheckCryptohomeIsMounted));
841 832
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); 1312 last_non_supervised_profile_path.BaseName().MaybeAsASCII());
1322 FinishDeletingProfile(profile_to_delete_path); 1313 FinishDeletingProfile(profile_to_delete_path);
1323 } 1314 }
1324 } 1315 }
1325 } 1316 }
1326 #endif 1317 #endif
1327 1318
1328 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1319 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1329 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1320 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1330 } 1321 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698