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