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

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

Issue 2159233002: User menu button icon tweaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | 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 55004998fff8cab168ef10f41037d458d50be60c..92894b81f4c497f14f4fe0aa9309e73d9f175fca 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -184,7 +184,9 @@ class BackgroundColorHoverButton : public views::LabelButton {
BackgroundColorHoverButton(views::ButtonListener* listener,
const base::string16& text)
: views::LabelButton(listener, text) {
- SetImageLabelSpacing(views::kItemLabelSpacing);
+ SetImageLabelSpacing(switches::IsMaterialDesignUserMenu()
+ ? (kMaterialMenuEdgeMargin - 2)
+ : views::kItemLabelSpacing);
const int button_margin = switches::IsMaterialDesignUserMenu()
? kMaterialMenuEdgeMargin
: views::kButtonHEdgeMarginNew;
@@ -1713,6 +1715,7 @@ views::View* ProfileChooserView::CreateOptionsView(bool display_lock,
views::LabelButton* button = new BackgroundColorHoverButton(
this, profiles::GetProfileSwitcherTextForItem(item),
*image.ToImageSkia());
+ button->SetImageLabelSpacing(kMaterialMenuEdgeMargin);
open_other_profile_indexes_map_[button] = i;
layout->StartRow(1, 0);
@@ -1735,14 +1738,19 @@ 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_SWITCH_USERS_BUTTON);
- gfx::VectorIconId settings_icon = gfx::VectorIconId::ACCOUNT_BOX;
- if (!browser_->profile()->IsGuestSession()
- && switches::IsMaterialDesignUserMenu()) {
- text = l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_USERS_BUTTON);
- settings_icon = gfx::VectorIconId::SETTINGS;
+ base::string16 text;
+ gfx::VectorIconId settings_icon;
+ if (switches::IsMaterialDesignUserMenu()) {
+ text = browser_->profile()->IsGuestSession() ?
sky 2016/07/19 17:57:53 nit: how about a variable around 1704ish for is_gu
+ l10n_util::GetStringUTF16(IDS_PROFILES_EXIT_GUEST) :
+ l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_USERS_BUTTON);
+ settings_icon = browser_->profile()->IsGuestSession() ?
+ gfx::VectorIconId::CLOSE_ALL : gfx::VectorIconId::SETTINGS;
+ } else {
+ text = browser_->profile()->IsGuestSession() ?
+ l10n_util::GetStringUTF16(IDS_PROFILES_EXIT_GUEST) :
+ l10n_util::GetStringUTF16(IDS_PROFILES_SWITCH_USERS_BUTTON);
+ settings_icon = gfx::VectorIconId::ACCOUNT_BOX;
}
users_button_ = new BackgroundColorHoverButton(
this, text, gfx::CreateVectorIcon(settings_icon, kIconSize,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698