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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

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/ui/cocoa/profiles/profile_chooser_controller.mm ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 5ba26e0ff8f0ac9740882b6080109c3a86622402..d1dbe58e9890d3673b4cd76c5872305e7b6fb179 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -673,11 +673,14 @@ void ProfileChooserView::ButtonPressed(views::Button* sender,
sender->SetEnabled(false);
if (sender == users_button_) {
- profiles::ShowUserManagerMaybeWithTutorial(browser_->profile());
- PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER);
// If this is a guest session, also close all the guest browser windows.
- if (browser_->profile()->IsGuestSession())
+ if (browser_->profile()->IsGuestSession()) {
+ chrome::ShowUserManager(base::FilePath());
profiles::CloseGuestProfileWindows();
+ } else {
+ chrome::ShowUserManager(browser_->profile()->GetPath());
+ }
+ PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER);
} else if (sender == go_incognito_button_) {
DCHECK(ShouldShowGoIncognito());
chrome::NewIncognitoWindow(browser_);
@@ -723,7 +726,7 @@ void ProfileChooserView::ButtonPressed(views::Button* sender,
} else if (sender == add_person_button_) {
ProfileMetrics::LogProfileNewAvatarMenuNotYou(
ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON);
- profiles::ShowUserManagerMaybeWithTutorial(browser_->profile());
+ chrome::ShowUserManager(browser_->profile()->GetPath());
} else if (sender == disconnect_button_) {
ProfileMetrics::LogProfileNewAvatarMenuNotYou(
ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_DISCONNECT);
@@ -974,12 +977,16 @@ views::View* ProfileChooserView::CreateTutorialView(
button_columns->AddColumn(views::GridLayout::TRAILING,
views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
- *link = CreateLink(link_text, this);
- (*link)->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- (*link)->SetAutoColorReadabilityEnabled(false);
- (*link)->SetEnabledColor(SK_ColorWHITE);
layout->StartRowWithPadding(1, 1, 0, views::kUnrelatedControlVerticalSpacing);
- layout->AddView(*link);
+ if (!link_text.empty()) {
+ *link = CreateLink(link_text, this);
+ (*link)->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ (*link)->SetAutoColorReadabilityEnabled(false);
+ (*link)->SetEnabledColor(SK_ColorWHITE);
+ layout->AddView(*link);
+ } else {
+ layout->SkipColumns(1);
+ }
*button = new views::LabelButton(this, button_text);
(*button)->SetHorizontalAlignment(gfx::ALIGN_CENTER);
@@ -1408,12 +1415,6 @@ views::View* ProfileChooserView::CreateAccountRemovalView() {
views::View* ProfileChooserView::CreateWelcomeUpgradeTutorialViewIfNeeded(
bool tutorial_shown, const AvatarMenu::Item& avatar_item){
Profile* profile = browser_->profile();
- if (!avatar_item.signed_in) {
- profile->GetPrefs()->SetInteger(
- prefs::kProfileAvatarTutorialShown,
- signin_ui_util::kUpgradeWelcomeTutorialShowMax + 1);
- return NULL;
- }
const int show_count = profile->GetPrefs()->GetInteger(
prefs::kProfileAvatarTutorialShown);
@@ -1427,18 +1428,21 @@ views::View* ProfileChooserView::CreateWelcomeUpgradeTutorialViewIfNeeded(
profile->GetPrefs()->SetInteger(
prefs::kProfileAvatarTutorialShown, show_count + 1);
}
-
ProfileMetrics::LogProfileNewAvatarMenuUpgrade(
ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_VIEW);
+ // For local profiles, the "Not you" link doesn't make sense.
+ base::string16 link_message = avatar_item.signed_in ?
+ l10n_util::GetStringFUTF16(IDS_PROFILES_NOT_YOU, avatar_item.name) :
+ base::string16();
+
return CreateTutorialView(
profiles::TUTORIAL_MODE_WELCOME_UPGRADE,
l10n_util::GetStringUTF16(
IDS_PROFILES_WELCOME_UPGRADE_TUTORIAL_TITLE),
l10n_util::GetStringUTF16(
IDS_PROFILES_WELCOME_UPGRADE_TUTORIAL_CONTENT_TEXT),
- l10n_util::GetStringFUTF16(
- IDS_PROFILES_NOT_YOU, avatar_item.name),
+ link_message,
l10n_util::GetStringUTF16(IDS_PROFILES_TUTORIAL_WHATS_NEW_BUTTON),
&tutorial_not_you_link_,
&tutorial_see_whats_new_button_);
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698