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

Unified Diff: chrome/browser/ui/views/profiles/user_manager_view.cc

Issue 585653002: After locking a profile and showing the User Manager, make Guest the active profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 months 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
Index: chrome/browser/ui/views/profiles/user_manager_view.cc
diff --git a/chrome/browser/ui/views/profiles/user_manager_view.cc b/chrome/browser/ui/views/profiles/user_manager_view.cc
index 8f6a80ccd6a377c090e9a8801e9cf60eeee93d11..55316d239cff2956aba2e025d4a015fe91177c16 100644
--- a/chrome/browser/ui/views/profiles/user_manager_view.cc
+++ b/chrome/browser/ui/views/profiles/user_manager_view.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_window.h"
+#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -72,6 +73,10 @@ void UserManagerView::Show(const base::FilePath& profile_path_to_focus,
profiles::UserManagerTutorialMode tutorial_mode) {
ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER);
if (instance_) {
+ // If we are showing the User Manager after locking a profile, change the
+ // active profile to Guest.
+ profiles::SetActiveProfileToGuestIfLocked();
+
// If there's a user manager window open already, just activate it.
instance_->GetWidget()->Activate();
return;
@@ -104,6 +109,10 @@ void UserManagerView::OnGuestProfileCreated(
const base::FilePath& profile_path_to_focus,
Profile* guest_profile,
const std::string& url) {
+ // If we are showing the User Manager after locking a profile, change the
+ // active profile to Guest.
+ profiles::SetActiveProfileToGuestIfLocked();
+
instance_ = instance.release(); // |instance_| takes over ownership.
instance_->Init(profile_path_to_focus, guest_profile, GURL(url));
}

Powered by Google App Engine
This is Rietveld 408576698