| OLD | NEW |
| 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 Loading... |
| 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); | |
| 928 } | 923 } |
| 929 | 924 |
| 930 bool BrowserAccessibilityManagerAndroid::IsSlider( | 925 bool BrowserAccessibilityManagerAndroid::IsSlider( |
| 931 JNIEnv* env, | 926 JNIEnv* env, |
| 932 const JavaParamRef<jobject>& obj, | 927 const JavaParamRef<jobject>& obj, |
| 933 jint id) { | 928 jint id) { |
| 934 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); | 929 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); |
| 935 if (!node) | 930 if (!node) |
| 936 return false; | 931 return false; |
| 937 | 932 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 | 984 |
| 990 JNIEnv* env = AttachCurrentThread(); | 985 JNIEnv* env = AttachCurrentThread(); |
| 991 return root_manager->java_ref().get(env); | 986 return root_manager->java_ref().get(env); |
| 992 } | 987 } |
| 993 | 988 |
| 994 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 989 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
| 995 return RegisterNativesImpl(env); | 990 return RegisterNativesImpl(env); |
| 996 } | 991 } |
| 997 | 992 |
| 998 } // namespace content | 993 } // namespace content |
| OLD | NEW |