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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 631163004: Mac - show user manager before opening browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_window.h » ('j') | chrome/browser/profiles/profile_window.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 6435203b5b101bbd62cfa8346ea3e8cc0cd387b3..063b9cd7de47d57c868eced6b08d4a42a14154be 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -205,6 +205,11 @@ bool IsProfileSignedOut(Profile* profile) {
return cache.ProfileIsSigninRequiredAtIndex(profile_index);
}
+bool IsGuestModeEnabled() {
+ const PrefService* prefs = g_browser_process->local_state();
+ return prefs->GetBoolean(prefs::kBrowserGuestModeEnabled);
+}
+
} // anonymous namespace
@interface AppController (Private)
@@ -1102,8 +1107,15 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
}
break;
case IDC_TASK_MANAGER:
Mark Mentovai 2014/10/07 20:22:57 How does the task manager interact with this? It’s
Mike Lerman 2014/10/08 15:41:37 Web UI can be launched from the "Stats for nerds"
Mark Mentovai 2014/10/08 16:43:22 Mike Lerman wrote:
Mike Lerman 2014/10/08 20:23:41 Ok. I can do this for Mac implementation (Windows
- content::RecordAction(UserMetricsAction("TaskManager"));
- TaskManagerMac::Show();
+ if ([self safeLastProfileForNewWindows]->IsGuestSession() &&
+ !IsGuestModeEnabled()) {
+ UserManager::Show(lastProfile->GetPath(),
+ profiles::USER_MANAGER_NO_TUTORIAL,
+ profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER);
+ } else {
+ content::RecordAction(UserMetricsAction("TaskManager"));
+ TaskManagerMac::Show();
+ }
break;
case IDC_OPTIONS:
[self showPreferences:sender];
@@ -1382,7 +1394,14 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
chrome::ShowSettings(browser);
} else {
// No browser window, so create one for the options tab.
- chrome::OpenOptionsWindow([self safeLastProfileForNewWindows]);
+ Profile* lastProfile = [self safeLastProfileForNewWindows];
+ if (lastProfile->IsGuestSession() && !IsGuestModeEnabled()) {
+ UserManager::Show(lastProfile->GetPath(),
+ profiles::USER_MANAGER_NO_TUTORIAL,
+ profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS);
+ } else {
+ chrome::OpenOptionsWindow([self safeLastProfileForNewWindows]);
+ }
}
}
@@ -1391,7 +1410,14 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
chrome::ShowAboutChrome(browser);
} else {
// No browser window, so create one for the about tab.
- chrome::OpenAboutWindow([self safeLastProfileForNewWindows]);
+ Profile* lastProfile = [self safeLastProfileForNewWindows];
+ if (lastProfile->IsGuestSession() && !IsGuestModeEnabled()) {
Mark Mentovai 2014/10/07 20:22:57 This is getting kind of repetitive. Maybe it could
Mike Lerman 2014/10/08 15:41:37 Done - refactored.
+ UserManager::Show(lastProfile->GetPath(),
+ profiles::USER_MANAGER_NO_TUTORIAL,
+ profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME);
+ } else {
+ chrome::OpenAboutWindow([self safeLastProfileForNewWindows]);
+ }
}
}
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_window.h » ('j') | chrome/browser/profiles/profile_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698