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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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