| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |