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

Unified Diff: android_webview/native/aw_contents.cc

Issue 12697002: [Android WebView] Provide more information about WebView for web debugging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 9 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
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index f740291f25fc9e02c4696e9d8e8d5d359bd86b99..f4cc2e2b4e3ceb969645c8af7fa4fe18bb00655a 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -21,6 +21,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
+#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/message_loop.h"
@@ -672,6 +673,18 @@ jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) {
return reinterpret_cast<jint>(pending_contents_.release());
}
+gfx::Point AwContents::GetLocationOnScreen() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null()) return gfx::Point();
+ std::vector<int> location;
+ base::android::JavaIntArrayToIntVector(
+ env,
+ Java_AwContents_getLocationOnScreen(env, obj.obj()).obj(),
+ &location);
+ return gfx::Point(location[0], location[1]);
+}
+
ScopedJavaLocalRef<jobject> AwContents::CapturePicture(JNIEnv* env,
jobject obj) {
return browser_view_renderer_->CapturePicture();
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698