Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 15741009: Native Android accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split RendererAccessibilityFocusOnly fix into separate changelist Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_android.cc
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc
index 511d67efaccd37662040888f0031233bd74204c2..c8e536dfb0e49667055165e792177b269cc37b55 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -12,8 +12,7 @@
#include "content/browser/accessibility/browser_accessibility_manager_android.h"
#include "content/common/accessibility_messages.h"
#include "content/common/accessibility_node_data.h"
-
-using base::android::ScopedJavaLocalRef;
+#include "jni/BrowserAccessibility_jni.h"
namespace content {
@@ -55,9 +54,12 @@ ScopedJavaLocalRef<jobject>
BrowserAccessibilityAndroid::GetAbsoluteRectJNI(
JNIEnv* env, jobject obj) const {
gfx::Rect rect = GetLocalBoundsRect();
-
- // TODO(aboxhall): replace with non-stub implementation
- return ScopedJavaLocalRef<jobject>(env, NULL);
+ return Java_BrowserAccessibility_createRect(
+ env,
+ static_cast<int>(rect.x()),
+ static_cast<int>(rect.y()),
+ static_cast<int>(rect.right()),
+ static_cast<int>(rect.bottom()));
}
ScopedJavaLocalRef<jobject>
@@ -69,8 +71,12 @@ BrowserAccessibilityAndroid::GetRectInParentJNI(
rect.Offset(-parent_rect.OffsetFromOrigin());
}
- // TODO(aboxhall): replace with non-stub implementation
- return ScopedJavaLocalRef<jobject>(env, NULL);
+ return Java_BrowserAccessibility_createRect(
+ env,
+ static_cast<int>(rect.x()),
+ static_cast<int>(rect.y()),
+ static_cast<int>(rect.right()),
+ static_cast<int>(rect.bottom()));
}
jboolean
@@ -527,8 +533,7 @@ void BrowserAccessibilityAndroid::NotifyLiveRegionUpdate(string16& aria_live) {
}
bool RegisterBrowserAccessibility(JNIEnv* env) {
- // TODO(aboxhall): replace with non-stub implementation
- return false;
+ return RegisterNativesImpl(env);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698