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

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

Issue 2414533002: ash: Use legacy size for legacy logout button. (Closed)
Patch Set: 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..7bffdacf65330f5d7d0c3539fa6323c2e817b836 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 kButtonMinSize = MaterialDesignController::IsShelfMaterial()
sadrul 2016/10/12 00:43:42 I think this would just be 'const int button_size
xiyuan 2016/10/12 15:28:11 Done.
+ ? kTrayItemSize
+ : GetTrayConstant(TRAY_ITEM_HEIGHT_LEGACY);
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, kButtonMinSize));
} 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(kButtonMinSize, kButtonMinSize));
}
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