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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager_android.cc

Issue 2465403003: Android accessibility: automatically focus links (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 913
914 void BrowserAccessibilityManagerAndroid::SetAccessibilityFocus( 914 void BrowserAccessibilityManagerAndroid::SetAccessibilityFocus(
915 JNIEnv* env, 915 JNIEnv* env,
916 const JavaParamRef<jobject>& obj, 916 const JavaParamRef<jobject>& obj,
917 jint id) { 917 jint id) {
918 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); 918 BrowserAccessibilityAndroid* node = GetFromUniqueID(id);
919 if (!node) 919 if (!node)
920 return; 920 return;
921 921
922 node->manager()->SetAccessibilityFocus(*node); 922 node->manager()->SetAccessibilityFocus(*node);
923
924 // Auto-focus links, because some websites have skip links that are
925 // only visible when focused. See http://crbug.com/657157
926 if (node->IsLink())
927 node->manager()->SetFocus(*node);
923 } 928 }
924 929
925 bool BrowserAccessibilityManagerAndroid::IsSlider( 930 bool BrowserAccessibilityManagerAndroid::IsSlider(
926 JNIEnv* env, 931 JNIEnv* env,
927 const JavaParamRef<jobject>& obj, 932 const JavaParamRef<jobject>& obj,
928 jint id) { 933 jint id) {
929 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); 934 BrowserAccessibilityAndroid* node = GetFromUniqueID(id);
930 if (!node) 935 if (!node)
931 return false; 936 return false;
932 937
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 989
985 JNIEnv* env = AttachCurrentThread(); 990 JNIEnv* env = AttachCurrentThread();
986 return root_manager->java_ref().get(env); 991 return root_manager->java_ref().get(env);
987 } 992 }
988 993
989 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 994 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
990 return RegisterNativesImpl(env); 995 return RegisterNativesImpl(env);
991 } 996 }
992 997
993 } // namespace content 998 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698