Chromium Code Reviews| Index: chrome/browser/profiles/profile_window.cc |
| diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc |
| index 10b48e19cd03d7fa56cab89d3d442126198abc31..3a12a1fea43d000cc6d56ef3d244dc8243af38a3 100644 |
| --- a/chrome/browser/profiles/profile_window.cc |
| +++ b/chrome/browser/profiles/profile_window.cc |
| @@ -259,25 +259,38 @@ void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, |
| ProfileMetrics::LogProfileAddNewUser(metric); |
| } |
| +void GuestBrowserCloseSuccess(const size_t profile_index) { |
|
noms (inactive)
2014/08/26 20:17:32
I don't think you need the profile_index as an arg
Mike Lerman
2014/08/27 14:11:38
The on_close_confirmed parameter of CloseAllBrowse
|
| + chrome::ShowUserManager(base::FilePath()); |
| +} |
| + |
| void CloseGuestProfileWindows() { |
| ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| Profile* profile = profile_manager->GetProfileByPath( |
| ProfileManager::GetGuestProfilePath()); |
| if (profile) { |
| - BrowserList::CloseAllBrowsersWithProfile(profile); |
| + BrowserList::CloseAllBrowsersWithProfile(profile, |
| + base::Bind(&GuestBrowserCloseSuccess), |
| + base::Bind(&BrowserList::DoNothing)); |
| } |
| } |
| -void LockProfile(Profile* profile) { |
| - DCHECK(profile); |
| +void LockBrowserCloseSuccess(const size_t profile_index) { |
| ProfileInfoCache& cache = |
| g_browser_process->profile_manager()->GetProfileInfoCache(); |
| + DCHECK_LT(profile_index, cache.GetNumberOfProfiles()); |
| + |
| + cache.SetProfileSigninRequiredAtIndex(profile_index, true); |
| + chrome::ShowUserManager(cache.GetPathOfProfileAtIndex(profile_index)); |
| +} |
| - size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| - cache.SetProfileSigninRequiredAtIndex(index, true); |
| - chrome::ShowUserManager(profile->GetPath()); |
| - BrowserList::CloseAllBrowsersWithProfile(profile); |
| +void LockProfile(Profile* profile) { |
| + DCHECK(profile); |
| + if (profile) { |
| + BrowserList::CloseAllBrowsersWithProfile(profile, |
| + base::Bind(&LockBrowserCloseSuccess), |
| + base::Bind(&BrowserList::DoNothing)); |
| + } |
| } |
| void CreateGuestProfileForUserManager( |