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

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

Issue 64313005: Fix crash when locking a profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix flaky test Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_window.h" 5 #include "chrome/browser/profiles/profile_window.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/profiles/profile_manager.h" 11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_dialogs.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 #include "content/public/browser/user_metrics.h" 15 #include "content/public/browser/user_metrics.h"
15 16
16 #if !defined(OS_IOS) 17 #if !defined(OS_IOS)
17 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
18 #include "chrome/browser/ui/browser_list.h" 19 #include "chrome/browser/ui/browser_list.h"
19 #include "chrome/browser/ui/browser_list_observer.h" 20 #include "chrome/browser/ui/browser_list_observer.h"
20 #include "chrome/browser/ui/browser_window.h" 21 #include "chrome/browser/ui/browser_window.h"
21 #include "chrome/browser/ui/startup/startup_browser_creator.h" 22 #include "chrome/browser/ui/startup/startup_browser_creator.h"
22 #endif // !defined (OS_IOS) 23 #endif // !defined (OS_IOS)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 void CloseGuestProfileWindows() { 170 void CloseGuestProfileWindows() {
170 ProfileManager* profile_manager = g_browser_process->profile_manager(); 171 ProfileManager* profile_manager = g_browser_process->profile_manager();
171 Profile* profile = profile_manager->GetProfileByPath( 172 Profile* profile = profile_manager->GetProfileByPath(
172 ProfileManager::GetGuestProfilePath()); 173 ProfileManager::GetGuestProfilePath());
173 174
174 if (profile) { 175 if (profile) {
175 BrowserList::CloseAllBrowsersWithProfile(profile); 176 BrowserList::CloseAllBrowsersWithProfile(profile);
176 } 177 }
177 } 178 }
178 179
180 void LockProfile(Profile* profile) {
181 DCHECK(profile);
182 ProfileInfoCache& cache =
183 g_browser_process->profile_manager()->GetProfileInfoCache();
184
185 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
186 cache.SetProfileSigninRequiredAtIndex(index, true);
187 chrome::ShowUserManager(profile->GetPath());
188 BrowserList::CloseAllBrowsersWithProfile(profile);
189 }
190
179 } // namespace profiles 191 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/ui/views/avatar_menu_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698