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

Unified Diff: chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm

Issue 199533004: [Mac, Win] Show a user manager tutorial once per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gab & nikita comments Created 6 years, 9 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/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..babfff07818604e74a6c7ec24c5ca525f67b7e66 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,28 @@ 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.
+ bool tutorialShown = browser_->profile()->GetPrefs()->GetBoolean(
+ prefs::kProfileUserManagerTutorialShown);
+ if (!tutorialShown) {
+ browser_->profile()->GetPrefs()->SetBoolean(
Alexei Svitkine (slow) 2014/03/14 21:04:40 Nit: Cache a pointer to the pref store above to av
noms (inactive) 2014/03/17 21:52:23 Done.
+ prefs::kProfileUserManagerTutorialShown, true);
+ }
+ UserManagerMac::Show(profilePath, !tutorialShown);
}
- (IBAction)switchToGuestProfile:(id)sender {
@@ -1212,4 +1220,3 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
return label.autorelease();
}
@end
-

Powered by Google App Engine
This is Rietveld 408576698