Index: chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
diff --git a/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
index 76d5e19ce4c0596e4d58f854487ae58a0e004270..d692754b6d5736d424c7c4cd40f5403dbce487d5 100644 |
--- a/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
+++ b/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
@@ -27,11 +27,11 @@ |
#include "chrome/browser/signin/signin_manager_factory.h" |
#include "chrome/browser/signin/signin_promo.h" |
#include "chrome/browser/ui/browser.h" |
-#include "chrome/browser/ui/browser_dialogs.h" |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/chrome_style.h" |
#import "chrome/browser/ui/cocoa/info_bubble_view.h" |
#import "chrome/browser/ui/cocoa/info_bubble_window.h" |
+#import "chrome/browser/ui/cocoa/user_manager_mac.h" |
#include "chrome/browser/ui/singleton_tabs.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
@@ -585,20 +585,31 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
- (IBAction)switchToProfile:(id)sender { |
// Check the event flags to see if a new window should be created. |
- bool always_create = ui::WindowOpenDispositionFromNSEvent( |
+ bool alwaysCreate = ui::WindowOpenDispositionFromNSEvent( |
[NSApp currentEvent]) == NEW_WINDOW; |
- avatarMenu_->SwitchToProfile([sender tag], always_create, |
+ avatarMenu_->SwitchToProfile([sender tag], alwaysCreate, |
ProfileMetrics::SWITCH_PROFILE_ICON); |
} |
- (IBAction)showUserManager:(id)sender { |
// Only non-guest users appear in the User Manager. |
- base::FilePath profile_path; |
+ base::FilePath profilePath; |
if (!isGuestSession_) { |
- size_t active_index = avatarMenu_->GetActiveProfileIndex(); |
- profile_path = avatarMenu_->GetItemAt(active_index).profile_path; |
+ size_t activeIndex = avatarMenu_->GetActiveProfileIndex(); |
+ profilePath = avatarMenu_->GetItemAt(activeIndex).profile_path; |
} |
- chrome::ShowUserManager(profile_path); |
+ |
+ // Show the tutorial if it hasn't been shown before. This is the same logic |
+ // as in profile_chooser_view.cc. |
+ PrefService* prefService = browser_->profile()->GetPrefs(); |
+ bool tutorialShown = prefService->GetBoolean( |
+ prefs::kProfileUserManagerTutorialShown); |
+ if (!tutorialShown) |
+ prefService->SetBoolean(prefs::kProfileUserManagerTutorialShown, true); |
+ |
+ UserManagerMac::Show( |
+ profilePath, tutorialShown ? profiles::USER_MANAGER_NO_TUTORIAL : |
+ profiles::USER_MANAGER_TUTORIAL_OVERVIEW); |
} |
- (IBAction)switchToGuestProfile:(id)sender { |
@@ -1212,4 +1223,3 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
return label.autorelease(); |
} |
@end |
- |