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

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

Issue 75483005: Revert 235801 "Fix crash when locking a profile. The crash is ha..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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"
14 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/user_metrics.h" 14 #include "content/public/browser/user_metrics.h"
16 15
17 #if !defined(OS_IOS) 16 #if !defined(OS_IOS)
18 #include "chrome/browser/ui/browser_finder.h" 17 #include "chrome/browser/ui/browser_finder.h"
19 #include "chrome/browser/ui/browser_list.h" 18 #include "chrome/browser/ui/browser_list.h"
20 #include "chrome/browser/ui/browser_list_observer.h" 19 #include "chrome/browser/ui/browser_list_observer.h"
21 #include "chrome/browser/ui/browser_window.h" 20 #include "chrome/browser/ui/browser_window.h"
22 #include "chrome/browser/ui/startup/startup_browser_creator.h" 21 #include "chrome/browser/ui/startup/startup_browser_creator.h"
23 #endif // !defined (OS_IOS) 22 #endif // !defined (OS_IOS)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void CloseGuestProfileWindows() { 169 void CloseGuestProfileWindows() {
171 ProfileManager* profile_manager = g_browser_process->profile_manager(); 170 ProfileManager* profile_manager = g_browser_process->profile_manager();
172 Profile* profile = profile_manager->GetProfileByPath( 171 Profile* profile = profile_manager->GetProfileByPath(
173 ProfileManager::GetGuestProfilePath()); 172 ProfileManager::GetGuestProfilePath());
174 173
175 if (profile) { 174 if (profile) {
176 BrowserList::CloseAllBrowsersWithProfile(profile); 175 BrowserList::CloseAllBrowsersWithProfile(profile);
177 } 176 }
178 } 177 }
179 178
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
191 } // namespace profiles 179 } // namespace profiles
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/profiles/profile_window.h ('k') | trunk/src/chrome/browser/ui/views/avatar_menu_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698