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

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

Issue 454153002: [Mac, Win] Only show the user manager tutorial if "See what's new" is clicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase all the time Created 6 years, 4 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 | « chrome/browser/profiles/profile_window.cc ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
index 4a8b03442b2746f06f7a76856450d117dd339318..34e55ef080d446ba48fa18d9555d360ee837bc47 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -814,14 +814,14 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
}
- (IBAction)showUserManager:(id)sender {
- profiles::ShowUserManagerMaybeWithTutorial(browser_->profile());
+ chrome::ShowUserManager(browser_->profile()->GetPath());
[self postActionPerformed:
ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER];
}
- (IBAction)exitGuest:(id)sender {
DCHECK(browser_->profile()->IsGuestSession());
- [self showUserManager:sender];
+ chrome::ShowUserManager(base::FilePath());
profiles::CloseGuestProfileWindows();
}
@@ -847,7 +847,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
[self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN];
}
-
- (IBAction)addAccount:(id)sender {
[self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT];
[self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT];
@@ -925,12 +924,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
[self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER];
}
-- (IBAction)addPerson:(id)sender {
- profiles::ShowUserManagerMaybeWithTutorial(browser_->profile());
- ProfileMetrics::LogProfileNewAvatarMenuNotYou(
- ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON);
-}
-
- (IBAction)disconnectProfile:(id)sender {
chrome::ShowSettings(browser_);
ProfileMetrics::LogProfileNewAvatarMenuNotYou(
@@ -1183,12 +1176,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
Profile* profile = browser_->profile();
const AvatarMenu::Item& avatarItem =
avatarMenu_->GetItemAt(avatarMenu_->GetActiveProfileIndex());
- if (!avatarItem.signed_in) {
- profile->GetPrefs()->SetInteger(
- prefs::kProfileAvatarTutorialShown,
- signin_ui_util::kUpgradeWelcomeTutorialShowMax + 1);
- return nil;
- }
const int showCount = profile->GetPrefs()->GetInteger(
prefs::kProfileAvatarTutorialShown);
@@ -1210,8 +1197,9 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
IDS_PROFILES_WELCOME_UPGRADE_TUTORIAL_TITLE);
NSString* contentMessage = l10n_util::GetNSString(
IDS_PROFILES_WELCOME_UPGRADE_TUTORIAL_CONTENT_TEXT);
- NSString* linkMessage = l10n_util::GetNSStringF(
- IDS_PROFILES_NOT_YOU, avatarItem.name);
+ // For local profiles, the "Not you" link doesn't make sense.
+ NSString* linkMessage = avatarItem.signed_in ?
+ l10n_util::GetNSStringF(IDS_PROFILES_NOT_YOU, avatarItem.name) : nil;
NSString* buttonMessage = l10n_util::GetNSString(
IDS_PROFILES_TUTORIAL_WHATS_NEW_BUTTON);
return [self tutorialViewWithMode:profiles::TUTORIAL_MODE_WELCOME_UPGRADE
@@ -1255,24 +1243,27 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
buttonSize.height += 2 * kTopBottomTextPadding;
[tutorialOkButton setFrameSize:buttonSize];
[tutorialOkButton setAlignment:NSCenterTextAlignment];
+
[tutorialOkButton setFrameOrigin:NSMakePoint(
kFixedMenuWidth - NSWidth([tutorialOkButton frame]) - kHorizontalSpacing,
yOffset)];
[container addSubview:tutorialOkButton];
- NSButton* learnMoreLink =
- [self linkButtonWithTitle:linkMessage
- frameOrigin:NSZeroPoint
- action:linkAction];
- [[learnMoreLink cell] setTextColor:[NSColor whiteColor]];
- CGFloat linkYOffset = yOffset + (NSHeight([tutorialOkButton frame]) -
- NSHeight([learnMoreLink frame])) / 2;
- [learnMoreLink setFrameOrigin:NSMakePoint(kHorizontalSpacing, linkYOffset)];
- [container addSubview:learnMoreLink];
-
- yOffset = std::max(NSMaxY([learnMoreLink frame]),
- NSMaxY([tutorialOkButton frame])) + kVerticalSpacing;
-
+ if (linkMessage) {
+ NSButton* learnMoreLink =
+ [self linkButtonWithTitle:linkMessage
+ frameOrigin:NSZeroPoint
+ action:linkAction];
+ [[learnMoreLink cell] setTextColor:[NSColor whiteColor]];
+ CGFloat linkYOffset = yOffset + (NSHeight([tutorialOkButton frame]) -
+ NSHeight([learnMoreLink frame])) / 2;
+ [learnMoreLink setFrameOrigin:NSMakePoint(kHorizontalSpacing, linkYOffset)];
+ [container addSubview:learnMoreLink];
+ yOffset = std::max(NSMaxY([learnMoreLink frame]),
+ NSMaxY([tutorialOkButton frame])) + kVerticalSpacing;
+ } else {
+ yOffset = NSMaxY([tutorialOkButton frame]) + kVerticalSpacing;
+ }
// Adds body content.
NSTextField* contentLabel = BuildLabel(
contentMessage,
@@ -1779,7 +1770,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
return container.autorelease();
}
-
- (NSView*)buildSwitchUserView {
ProfileMetrics::LogProfileNewAvatarMenuNotYou(
ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_VIEW);
@@ -1817,7 +1807,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
text:l10n_util::GetNSString(
IDS_PROFILES_ADD_PERSON_BUTTON)
imageResourceId:IDR_ICON_PROFILES_MENU_AVATAR
- action:@selector(addPerson:)];
+ action:@selector(showUserManager:)];
[container addSubview:addPersonButton];
yOffset = NSMaxY([addPersonButton frame]);
« no previous file with comments | « chrome/browser/profiles/profile_window.cc ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698