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

Unified Diff: ui/views/view.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Make patch smaller temporarily. Created 4 years, 9 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
« ui/views/view.h ('K') | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 4c62a000f61882cf5115a2f541ba8e7b86fb8af5..7e8bdd88edc87ee200e495e519eaec0694bf9d6e 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1201,6 +1201,32 @@ void View::SetNextFocusableView(View* view) {
next_focusable_view_ = view;
}
+void View::SetFocusBehavior(FocusBehavior focus_behavior) {
+ switch (focus_behavior) {
+ case ALWAYS:
+ SetFocusable(true);
+ SetAccessibilityFocusable(true);
+ break;
+ case NEVER:
+ SetFocusable(false);
+ SetAccessibilityFocusable(false);
+ break;
+ case ACCESSIBLE_ONLY:
+ SetFocusable(false);
+ SetAccessibilityFocusable(true);
+ break;
+ case CONTROL:
+#if defined(OS_MACOSX)
tapted 2016/03/15 05:05:32 This might be more readable with something like (a
karandeepb 2016/03/17 07:24:47 Done.
+ SetFocusable(false);
+ SetAccessibilityFocusable(true);
+#else
+ SetFocusable(true);
+ SetAccessibilityFocusable(true);
+#endif
+ break;
+ }
+}
+
void View::SetFocusable(bool focusable) {
if (focusable_ == focusable)
return;
« ui/views/view.h ('K') | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698