| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 void BrowserAccessibilityManagerAndroid::SetContentViewCore( | 84 void BrowserAccessibilityManagerAndroid::SetContentViewCore( |
| 85 ScopedJavaLocalRef<jobject> content_view_core) { | 85 ScopedJavaLocalRef<jobject> content_view_core) { |
| 86 if (content_view_core.is_null()) | 86 if (content_view_core.is_null()) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 JNIEnv* env = AttachCurrentThread(); | 89 JNIEnv* env = AttachCurrentThread(); |
| 90 java_ref_ = JavaObjectWeakGlobalRef( | 90 java_ref_ = JavaObjectWeakGlobalRef( |
| 91 env, Java_BrowserAccessibilityManager_create( | 91 env, Java_BrowserAccessibilityManager_create( |
| 92 env, reinterpret_cast<jint>(this), content_view_core.obj()).obj()); | 92 env, reinterpret_cast<intptr_t>(this), |
| 93 content_view_core.obj()).obj()); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void BrowserAccessibilityManagerAndroid::NotifyAccessibilityEvent( | 96 void BrowserAccessibilityManagerAndroid::NotifyAccessibilityEvent( |
| 96 blink::WebAXEvent event_type, | 97 blink::WebAXEvent event_type, |
| 97 BrowserAccessibility* node) { | 98 BrowserAccessibility* node) { |
| 98 JNIEnv* env = AttachCurrentThread(); | 99 JNIEnv* env = AttachCurrentThread(); |
| 99 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 100 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 100 if (obj.is_null()) | 101 if (obj.is_null()) |
| 101 return; | 102 return; |
| 102 | 103 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { | 367 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { |
| 367 // The Java layer handles the root scroll offset. | 368 // The Java layer handles the root scroll offset. |
| 368 return false; | 369 return false; |
| 369 } | 370 } |
| 370 | 371 |
| 371 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 372 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
| 372 return RegisterNativesImpl(env); | 373 return RegisterNativesImpl(env); |
| 373 } | 374 } |
| 374 | 375 |
| 375 } // namespace content | 376 } // namespace content |
| OLD | NEW |