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

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

Issue 2429923002: Implement all system menu title row buttons for Ash MD (Closed)
Patch Set: OS_WIN define in tests 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 | « ash/common/system/tray_accessibility.h ('k') | ash/resources/vector_icons/BUILD.gn » ('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 b41dce34008ac0a4fd2d501c609f1b09adb94db8..4cd70f3987976c982963250a75a6963630749979 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -18,6 +18,7 @@
#include "ash/common/system/tray/tray_item_more.h"
#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/system/tray/tray_popup_label_button.h"
+#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/wm_shell.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "base/strings/utf_string_conversions.h"
@@ -230,8 +231,7 @@ void AccessibilityDetailedView::AppendAccessibilityList() {
void AccessibilityDetailedView::AppendHelpEntries() {
// Currently the help page requires a browser window.
// TODO(yoshiki): show this even on login/lock screen. crbug.com/158286
- if (login_ == LoginStatus::NOT_LOGGED_IN || login_ == LoginStatus::LOCKED ||
- WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen())
+ if (!CanOpenWebUISettings(login_))
return;
views::View* bottom_row = new View();
@@ -322,21 +322,31 @@ void AccessibilityDetailedView::HandleViewClicked(views::View* view) {
void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender,
const ui::Event& event) {
- if (MaterialDesignController::UseMaterialDesignSystemIcons())
- return;
-
- SystemTrayController* controller = WmShell::Get()->system_tray_controller();
if (sender == help_view_)
- controller->ShowAccessibilityHelp();
+ ShowHelp();
else if (sender == settings_view_)
- controller->ShowAccessibilitySettings();
- else
- return;
- owner()->system_tray()->CloseSystemBubble();
+ ShowSettings();
+}
+
+void AccessibilityDetailedView::CreateExtraTitleRowButtons() {
+ if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
+ help_view_ = title_row()->AddHelpButton(this, login_);
+ settings_view_ = title_row()->AddSettingsButton(this, login_);
+ }
}
void AccessibilityDetailedView::ShowSettings() {
- WmShell::Get()->system_tray_controller()->ShowAccessibilitySettings();
+ if (CanOpenWebUISettings(login_)) {
+ WmShell::Get()->system_tray_controller()->ShowAccessibilitySettings();
+ owner()->system_tray()->CloseSystemBubble();
+ }
+}
+
+void AccessibilityDetailedView::ShowHelp() {
+ if (CanOpenWebUISettings(login_)) {
+ WmShell::Get()->system_tray_controller()->ShowAccessibilityHelp();
+ owner()->system_tray()->CloseSystemBubble();
+ }
}
} // namespace tray
« no previous file with comments | « ash/common/system/tray_accessibility.h ('k') | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698