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

Unified Diff: chrome/browser/ui/views/toolbar/app_menu.cc

Issue 1982073002: Fix accessibility of buttons inside Chrome menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/app_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 8e753d99a293d6c28163afd1bd20f6350bfa68ac..c12b12750a3f0fea3efda2c19181edd0038d63bf 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -44,6 +44,7 @@
#include "grit/theme_resources.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPaint.h"
+#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
#include "ui/base/material_design/material_design_controller.h"
@@ -122,6 +123,11 @@ class FullscreenButton : public ImageButton {
return pref;
}
+ void GetAccessibleState(ui::AXViewState* state) override {
+ ImageButton::GetAccessibleState(state);
+ state->role = ui::AX_ROLE_MENU_ITEM;
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(FullscreenButton);
};
@@ -299,6 +305,11 @@ class InMenuButton : public LabelButton {
in_menu_background_->SetOtherButtons(left, right);
}
+ void GetAccessibleState(ui::AXViewState* state) override {
+ LabelButton::GetAccessibleState(state);
+ state->role = ui::AX_ROLE_MENU_ITEM;
+ }
+
// views::LabelButton
void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
if (theme) {
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698