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