Chromium Code Reviews| 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]); |
| + } |
| } |
| } |