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 <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 node->IsCheckable(), | 211 node->IsCheckable(), |
212 node->IsChecked(), | 212 node->IsChecked(), |
213 node->IsClickable(), | 213 node->IsClickable(), |
214 node->IsEnabled(), | 214 node->IsEnabled(), |
215 node->IsFocusable(), | 215 node->IsFocusable(), |
216 node->IsFocused(), | 216 node->IsFocused(), |
217 node->IsPassword(), | 217 node->IsPassword(), |
218 node->IsScrollable(), | 218 node->IsScrollable(), |
219 node->IsSelected(), | 219 node->IsSelected(), |
220 node->IsVisibleToUser()); | 220 node->IsVisibleToUser()); |
221 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoStringAttributes( | 221 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoClassName( |
222 env, obj, info, | 222 env, obj, info, |
223 base::android::ConvertUTF8ToJavaString(env, node->GetClassName()).obj(), | 223 base::android::ConvertUTF8ToJavaString(env, node->GetClassName()).obj()); |
224 base::android::ConvertUTF16ToJavaString(env, node->GetText()).obj()); | 224 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoContentDescription( |
| 225 env, obj, info, |
| 226 base::android::ConvertUTF16ToJavaString(env, node->GetText()).obj(), |
| 227 node->IsLink()); |
225 | 228 |
226 gfx::Rect absolute_rect = node->GetLocalBoundsRect(); | 229 gfx::Rect absolute_rect = node->GetLocalBoundsRect(); |
227 gfx::Rect parent_relative_rect = absolute_rect; | 230 gfx::Rect parent_relative_rect = absolute_rect; |
228 if (node->parent()) { | 231 if (node->parent()) { |
229 gfx::Rect parent_rect = node->parent()->GetLocalBoundsRect(); | 232 gfx::Rect parent_rect = node->parent()->GetLocalBoundsRect(); |
230 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); | 233 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); |
231 } | 234 } |
232 bool is_root = node->parent() == NULL; | 235 bool is_root = node->parent() == NULL; |
233 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoLocation( | 236 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoLocation( |
234 env, obj, info, | 237 env, obj, info, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { | 453 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { |
451 // The Java layer handles the root scroll offset. | 454 // The Java layer handles the root scroll offset. |
452 return false; | 455 return false; |
453 } | 456 } |
454 | 457 |
455 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 458 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
456 return RegisterNativesImpl(env); | 459 return RegisterNativesImpl(env); |
457 } | 460 } |
458 | 461 |
459 } // namespace content | 462 } // namespace content |
OLD | NEW |