Index: chrome/browser/profiles/profile_window.cc |
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc |
index d65dd17e1133816c98580c2a60ffc166435cb512..5070130d3963edd52ffa6e47668928bd14f4544e 100644 |
--- a/chrome/browser/profiles/profile_window.cc |
+++ b/chrome/browser/profiles/profile_window.cc |
@@ -10,6 +10,7 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/browser_dialogs.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/user_metrics.h" |
@@ -176,4 +177,15 @@ void CloseGuestProfileWindows() { |
} |
} |
+void LockProfile(Profile* profile) { |
+ DCHECK(profile); |
+ ProfileInfoCache& cache = |
+ g_browser_process->profile_manager()->GetProfileInfoCache(); |
+ |
+ size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
+ cache.SetProfileSigninRequiredAtIndex(index, true); |
+ chrome::ShowUserManager(profile->GetPath()); |
+ BrowserList::CloseAllBrowsersWithProfile(profile); |
+} |
+ |
} // namespace profiles |