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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 gfx::Rect absolute_rect = node->GetLocalBoundsRect(); | 241 gfx::Rect absolute_rect = node->GetLocalBoundsRect(); |
242 gfx::Rect parent_relative_rect = absolute_rect; | 242 gfx::Rect parent_relative_rect = absolute_rect; |
243 if (node->GetParent()) { | 243 if (node->GetParent()) { |
244 gfx::Rect parent_rect = node->GetParent()->GetLocalBoundsRect(); | 244 gfx::Rect parent_rect = node->GetParent()->GetLocalBoundsRect(); |
245 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); | 245 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); |
246 } | 246 } |
247 bool is_root = node->GetParent() == NULL; | 247 bool is_root = node->GetParent() == NULL; |
248 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoLocation( | 248 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoLocation( |
249 env, obj, info, | 249 env, obj, info, |
| 250 id, |
250 absolute_rect.x(), absolute_rect.y(), | 251 absolute_rect.x(), absolute_rect.y(), |
251 parent_relative_rect.x(), parent_relative_rect.y(), | 252 parent_relative_rect.x(), parent_relative_rect.y(), |
252 absolute_rect.width(), absolute_rect.height(), | 253 absolute_rect.width(), absolute_rect.height(), |
253 is_root); | 254 is_root); |
254 | 255 |
255 // New KitKat APIs | 256 // New KitKat APIs |
256 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoKitKatAttributes( | 257 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoKitKatAttributes( |
257 env, obj, info, | 258 env, obj, info, |
258 node->CanOpenPopup(), | 259 node->CanOpenPopup(), |
259 node->IsContentInvalid(), | 260 node->IsContentInvalid(), |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { | 495 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { |
495 // The Java layer handles the root scroll offset. | 496 // The Java layer handles the root scroll offset. |
496 return false; | 497 return false; |
497 } | 498 } |
498 | 499 |
499 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 500 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
500 return RegisterNativesImpl(env); | 501 return RegisterNativesImpl(env); |
501 } | 502 } |
502 | 503 |
503 } // namespace content | 504 } // namespace content |
OLD | NEW |