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

Unified Diff: ash/common/system/user/user_view.cc

Issue 2675893002: Remove some pre-md code from TrayPopupUtils and UserView. (Closed)
Patch Set: Created 3 years, 11 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 | « ash/common/system/tray/tray_popup_utils.cc ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/user/user_view.cc
diff --git a/ash/common/system/user/user_view.cc b/ash/common/system/user/user_view.cc
index b94f186801e9d7dfbbc3a0eeb1a7936bed92c811..ee5e276c0338825b3835f6b5c2cdaf8c34a3f442 100644
--- a/ash/common/system/user/user_view.cc
+++ b/ash/common/system/user/user_view.cc
@@ -56,30 +56,6 @@ bool UseMd() {
return MaterialDesignController::IsSystemTrayMenuMaterial();
}
-const int kPublicAccountLogoutButtonBorderImagesNormal[] = {
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
-};
-
-const int kPublicAccountLogoutButtonBorderImagesHovered[] = {
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_LABEL_BUTTON_HOVER_BACKGROUND,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
- IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER,
-};
-
// When a hover border is used, it is starting this many pixels before the icon
// position.
const int kTrayUserTileHoverBorderInset = 10;
@@ -490,29 +466,9 @@ void UserView::OnDidChangeFocus(View* focused_before, View* focused_now) {
}
void UserView::AddLogoutButton(LoginStatus login) {
- const base::string16 title =
- user::GetLocalizedSignOutStringForStatus(login, true);
- auto* logout_button =
- TrayPopupUtils::CreateTrayPopupBorderlessButton(this, title);
- logout_button->SetAccessibleName(title);
bruthig 2017/02/06 17:42:50 Why are we dropping the accessible name, isn't it
Evan Stade 2017/02/06 18:15:50 this is already done for us in the base class: htt
bruthig 2017/02/06 18:36:40 Gotcha, thx!
- logout_button_ = logout_button;
- if (UseMd()) {
- AddChildView(TrayPopupUtils::CreateVerticalSeparator());
- } else if (login == LoginStatus::PUBLIC) {
- // In public account mode, the logout button border has a custom color.
- std::unique_ptr<TrayPopupLabelButtonBorder> border(
- new TrayPopupLabelButtonBorder());
- border->SetPainter(false, views::Button::STATE_NORMAL,
- views::Painter::CreateImageGridPainter(
- kPublicAccountLogoutButtonBorderImagesNormal));
- border->SetPainter(false, views::Button::STATE_HOVERED,
- views::Painter::CreateImageGridPainter(
- kPublicAccountLogoutButtonBorderImagesHovered));
- border->SetPainter(false, views::Button::STATE_PRESSED,
- views::Painter::CreateImageGridPainter(
- kPublicAccountLogoutButtonBorderImagesHovered));
- logout_button_->SetBorder(std::move(border));
- }
+ AddChildView(TrayPopupUtils::CreateVerticalSeparator());
+ logout_button_ = TrayPopupUtils::CreateTrayPopupBorderlessButton(
+ this, user::GetLocalizedSignOutStringForStatus(login, true));
AddChildView(logout_button_);
}
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698