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

Unified Diff: ash/common/system/chromeos/session/logout_button_tray.cc

Issue 2414533002: ash: Use legacy size for legacy logout button. (Closed)
Patch Set: fix nit: kButtonMinSize -> button_size Created 4 years, 2 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: ash/common/system/chromeos/session/logout_button_tray.cc
diff --git a/ash/common/system/chromeos/session/logout_button_tray.cc b/ash/common/system/chromeos/session/logout_button_tray.cc
index 4e66f31c386f66ba9b6ddc065c4cc0a74e47d423..2847b7a115ad6bcaa56c6fde0922f98799af0499 100644
--- a/ash/common/system/chromeos/session/logout_button_tray.cc
+++ b/ash/common/system/chromeos/session/logout_button_tray.cc
@@ -119,7 +119,7 @@ LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf)
button_ = new LogoutButton(this);
}
tray_container()->AddChildView(button_);
- if (!ash::MaterialDesignController::IsShelfMaterial())
+ if (!MaterialDesignController::IsShelfMaterial())
tray_container()->SetBorder(views::Border::NullBorder());
WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this);
}
@@ -133,7 +133,7 @@ void LogoutButtonTray::SetShelfAlignment(ShelfAlignment alignment) {
// TrayBackgroundView::SetShelfAlignment() can lay it out correctly.
UpdateButtonTextAndImage(login_status_, alignment);
TrayBackgroundView::SetShelfAlignment(alignment);
- if (!ash::MaterialDesignController::IsShelfMaterial())
+ if (!MaterialDesignController::IsShelfMaterial())
tray_container()->SetBorder(views::Border::NullBorder());
}
@@ -182,17 +182,20 @@ void LogoutButtonTray::UpdateButtonTextAndImage(LoginStatus login_status,
login_status_ = login_status;
const base::string16 title =
user::GetLocalizedSignOutStringForStatus(login_status, false);
+ const int button_size = MaterialDesignController::IsShelfMaterial()
+ ? kTrayItemSize
+ : GetTrayConstant(TRAY_ITEM_HEIGHT_LEGACY);
Evan Stade 2016/10/20 16:43:16 minor quibble: technically I don't believe this te
if (alignment == SHELF_ALIGNMENT_BOTTOM) {
button_->SetText(title);
button_->SetImage(views::LabelButton::STATE_NORMAL, gfx::ImageSkia());
- button_->SetMinSize(gfx::Size(0, kTrayItemSize));
+ button_->SetMinSize(gfx::Size(0, button_size));
} else {
button_->SetText(base::string16());
button_->SetAccessibleName(title);
button_->SetImage(
views::LabelButton::STATE_NORMAL,
gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor));
- button_->SetMinSize(gfx::Size(kTrayItemSize, kTrayItemSize));
+ button_->SetMinSize(gfx::Size(button_size, button_size));
}
UpdateVisibility();
}
« 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