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

Unified Diff: ash/common/system/tray_accessibility.cc

Issue 2463163002: Update chromeos system menu buttons for MD. (Closed)
Patch Set: boxlayout has some annoying dchecks Created 4 years, 1 month 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_utils.cc ('k') | ash/common/system/user/user_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray_accessibility.cc
diff --git a/ash/common/system/tray_accessibility.cc b/ash/common/system/tray_accessibility.cc
index b20c742be2543a33c7ded0901d062792b62003ad..0756cd3aa7667a375ae4307aba53b6f30df14701 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -39,6 +39,10 @@
namespace ash {
namespace {
+bool UseMdMenu() {
+ return MaterialDesignController::IsSystemTrayMenuMaterial();
+}
+
enum AccessibilityState {
A11Y_NONE = 0,
A11Y_SPOKEN_FEEDBACK = 1 << 0,
@@ -102,7 +106,7 @@ class DefaultAccessibilityView : public TrayItemMore {
void UpdateStyle() override {
TrayItemMore::UpdateStyle();
- if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ if (!UseMdMenu())
return;
std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
@@ -169,7 +173,7 @@ AccessibilityDetailedView::AccessibilityDetailedView(SystemTrayItem* owner,
AppendAccessibilityList();
- if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ if (!UseMdMenu())
AppendHelpEntries();
CreateTitleRow(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_TITLE);
@@ -230,6 +234,7 @@ void AccessibilityDetailedView::AppendAccessibilityList() {
}
void AccessibilityDetailedView::AppendHelpEntries() {
+ DCHECK(!UseMdMenu());
// Currently the help page requires a browser window.
// TODO(yoshiki): show this even on login/lock screen. crbug.com/158286
if (!CanOpenWebUISettings(login_))
@@ -265,7 +270,7 @@ HoverHighlightView* AccessibilityDetailedView::AddScrollListItem(
bool checked,
const gfx::VectorIcon& icon) {
HoverHighlightView* container = new HoverHighlightView(this);
- if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
+ if (UseMdMenu()) {
gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor);
const int padding = (kMenuButtonSize - image.width()) / 2;
container->AddIconAndLabelCustomSize(
@@ -330,7 +335,7 @@ void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender,
}
void AccessibilityDetailedView::CreateExtraTitleRowButtons() {
- if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
+ if (UseMdMenu()) {
help_view_ = title_row()->AddHelpButton(this, login_);
settings_view_ = title_row()->AddSettingsButton(this, login_);
}
« no previous file with comments | « ash/common/system/tray/tray_utils.cc ('k') | ash/common/system/user/user_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698