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

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

Issue 2034093003: Added flags for previous code change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More unittest fix Created 4 years, 6 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/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 417c6fcc4d1f470afef3c4ef62e415290d4fc923..9a11a3701debf0db3f17cb22466cf5acfc163511 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -699,6 +699,7 @@ void ProfileChooserView::ResetView() {
current_profile_photo_ = NULL;
current_profile_name_ = NULL;
users_button_ = NULL;
+ go_incognito_button_ = NULL;
lock_button_ = NULL;
add_account_link_ = NULL;
gaia_signin_cancel_button_ = NULL;
@@ -911,6 +912,10 @@ void ProfileChooserView::ButtonPressed(views::Button* sender,
profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
}
PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER);
+ } else if (sender == go_incognito_button_) {
+ DCHECK(ShouldShowGoIncognito());
+ chrome::NewIncognitoWindow(browser_);
+ PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO);
} else if (sender == lock_button_) {
profiles::LockProfile(browser_->profile());
PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK);
@@ -1496,7 +1501,11 @@ views::View* ProfileChooserView::CreateOptionsView(bool display_lock) {
base::string16 text = browser_->profile()->IsGuestSession() ?
l10n_util::GetStringUTF16(IDS_PROFILES_EXIT_GUEST) :
- l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_USERS_BUTTON);
+ l10n_util::GetStringUTF16(IDS_PROFILES_SWITCH_USERS_BUTTON);
+ if (!browser_->profile()->IsGuestSession()
+ && switches::IsMaterialDesignUserMenu()) {
+ text = l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_USERS_BUTTON);
+ }
const int kIconSize = 16;
users_button_ = new BackgroundColorHoverButton(
this, text, gfx::CreateVectorIcon(gfx::VectorIconId::ACCOUNT_BOX,
@@ -1504,6 +1513,19 @@ views::View* ProfileChooserView::CreateOptionsView(bool display_lock) {
layout->StartRow(1, 0);
layout->AddView(users_button_);
+ if (!switches::IsMaterialDesignUserMenu() && ShouldShowGoIncognito()) {
+ layout->StartRow(1, 0);
+ layout->AddView(new views::Separator(views::Separator::HORIZONTAL));
+
+ ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
+ go_incognito_button_ = new BackgroundColorHoverButton(
+ this,
+ l10n_util::GetStringUTF16(IDS_PROFILES_GO_INCOGNITO_BUTTON),
+ *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_INCOGNITO));
+ layout->StartRow(1, 0);
+ layout->AddView(go_incognito_button_);
+ }
+
if (display_lock) {
layout->StartRow(1, 0);
layout->AddView(new views::Separator(views::Separator::HORIZONTAL));

Powered by Google App Engine
This is Rietveld 408576698