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

Unified Diff: ui/views/controls/button/button.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: ui/views/controls/button/button.cc
diff --git a/ui/views/controls/button/button.cc b/ui/views/controls/button/button.cc
index 9f7e5e283c2542c0a24d6d96e2cc6bce7791add6..65ce865d977e76a97e1bec4ebc4f39d5ea579f2c 100644
--- a/ui/views/controls/button/button.cc
+++ b/ui/views/controls/button/button.cc
@@ -24,6 +24,16 @@ Button::ButtonState Button::GetButtonStateFrom(ui::NativeTheme::State state) {
return Button::STATE_NORMAL;
}
+// static
+void Button::ConfigureDefaultFocus(Button* button) {
+#if defined(OS_MACOSX)
+ // On Mac, buttons are focusable only in full keyboard access mode.
+ button->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
+#else
+ button->SetFocusBehavior(FocusBehavior::ALWAYS);
+#endif
+}
+
////////////////////////////////////////////////////////////////////////////////
// Button, public:

Powered by Google App Engine
This is Rietveld 408576698