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

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

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased 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
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..6e6adf43ffe437f70b2fd8ee90c22de62465116f 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -284,6 +284,8 @@ class InMenuButton : public LabelButton {
~InMenuButton() override {}
void Init(InMenuButtonBackground::ButtonType type) {
+ // An InMenuButton should always be focusable regardless of the platform.
+ // Hence we don't use Button::ConfigureDefaultFocus().
SetFocusBehavior(FocusBehavior::ALWAYS);
set_request_focus_on_press(false);
SetHorizontalAlignment(gfx::ALIGN_CENTER);
@@ -553,6 +555,8 @@ class AppMenu::ZoomView : public AppMenuView {
IDR_FULLSCREEN_MENU_BUTTON);
fullscreen_button_->SetImage(ImageButton::STATE_NORMAL, full_screen_image);
+ // Since |fullscreen_button_| will reside in a menu, make it ALWAYS
+ // focusable regardless of the platform.
fullscreen_button_->SetFocusBehavior(FocusBehavior::ALWAYS);
fullscreen_button_->set_request_focus_on_press(false);
fullscreen_button_->set_tag(fullscreen_index);

Powered by Google App Engine
This is Rietveld 408576698