| 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..c9b1893ccdf874fee8b7378d25f4cbae7e2b932d 100644
|
| --- a/chrome/browser/app_controller_mac.mm
|
| +++ b/chrome/browser/app_controller_mac.mm
|
| @@ -1007,7 +1007,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
|
| // for a locked profile, we have to show the User Manager instead as the
|
| // locked profile needs authentication.
|
| if (IsProfileSignedOut(lastProfile)) {
|
| - UserManager::Show(lastProfile->GetPath(),
|
| + UserManager::Show(base::FilePath(),
|
| profiles::USER_MANAGER_NO_TUTORIAL,
|
| profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
|
| return;
|
| @@ -1102,8 +1102,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
|
| }
|
| break;
|
| case IDC_TASK_MANAGER:
|
| - content::RecordAction(UserMetricsAction("TaskManager"));
|
| - TaskManagerMac::Show();
|
| + chrome::OpenTaskManager(NULL);
|
| break;
|
| case IDC_OPTIONS:
|
| [self showPreferences:sender];
|
| @@ -1211,7 +1210,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
|
| // so we have to show the User Manager as well.
|
| Profile* lastProfile = [self lastProfile];
|
| if (lastProfile->IsGuestSession() || IsProfileSignedOut(lastProfile)) {
|
| - UserManager::Show(lastProfile->GetPath(),
|
| + UserManager::Show(base::FilePath(),
|
| profiles::USER_MANAGER_NO_TUTORIAL,
|
| profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
|
| } else {
|
| @@ -1319,6 +1318,15 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
|
| return profile;
|
| }
|
|
|
| +// Returns true if a browser window may be opened for the last active profile.
|
| +- (bool)canOpenNewBrowser {
|
| + Profile* profile = [self safeLastProfileForNewWindows];
|
| +
|
| + const PrefService* prefs = g_browser_process->local_state();
|
| + return !profile->IsGuestSession() ||
|
| + prefs->GetBoolean(prefs::kBrowserGuestModeEnabled);
|
| +}
|
| +
|
| // Various methods to open URLs that we get in a native fashion. We use
|
| // StartupBrowserCreator here because on the other platforms, URLs to open come
|
| // through the ProcessSingleton, and it calls StartupBrowserCreator. It's best
|
| @@ -1380,18 +1388,28 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
|
| if (Browser* browser = ActivateBrowser([self lastProfile])) {
|
| // Show options tab in the active browser window.
|
| chrome::ShowSettings(browser);
|
| - } else {
|
| + } else if ([self canOpenNewBrowser]) {
|
| // No browser window, so create one for the options tab.
|
| chrome::OpenOptionsWindow([self safeLastProfileForNewWindows]);
|
| + } else {
|
| + // No way to create a browser, default to the User Manager.
|
| + UserManager::Show(base::FilePath(),
|
| + profiles::USER_MANAGER_NO_TUTORIAL,
|
| + profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS);
|
| }
|
| }
|
|
|
| - (IBAction)orderFrontStandardAboutPanel:(id)sender {
|
| if (Browser* browser = ActivateBrowser([self lastProfile])) {
|
| chrome::ShowAboutChrome(browser);
|
| - } else {
|
| - // No browser window, so create one for the about tab.
|
| + } else if ([self canOpenNewBrowser]) {
|
| + // No browser window, so create one for the options tab.
|
| chrome::OpenAboutWindow([self safeLastProfileForNewWindows]);
|
| + } else {
|
| + // No way to create a browser, default to the User Manager.
|
| + UserManager::Show(base::FilePath(),
|
| + profiles::USER_MANAGER_NO_TUTORIAL,
|
| + profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME);
|
| }
|
| }
|
|
|
|
|