diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 13:23:53 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 13:23:53 +0000 |
commit | c93f8fdc946ce1e29d719f17d0489ec039cf64e8 (patch) | |
tree | 58156897238041bf6c5a6691619456250b3a98ce /android_webview/native | |
parent | 9628e0d1b18acb3ef20752bfa19737338d26346c (diff) | |
download | chromium_src-c93f8fdc946ce1e29d719f17d0489ec039cf64e8.zip chromium_src-c93f8fdc946ce1e29d719f17d0489ec039cf64e8.tar.gz chromium_src-c93f8fdc946ce1e29d719f17d0489ec039cf64e8.tar.bz2 |
[Android WebView] Provide more information about WebView for web debugging
Using only page title is not enough for identifying a WebView.
This change adds to the remote web debugging landing page more
information about debuggable WebViews.
Review URL: https://codereview.chromium.org/12697002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187573 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/native')
-rw-r--r-- | android_webview/native/aw_contents.cc | 13 | ||||
-rw-r--r-- | android_webview/native/aw_contents.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index f740291..f4cc2e2 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(); diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h index a72dc32..8f0d0ea 100644 --- a/android_webview/native/aw_contents.h +++ b/android_webview/native/aw_contents.h @@ -156,6 +156,7 @@ class AwContents : public FindHelper::Listener, virtual void Invalidate() OVERRIDE; virtual void OnNewPicture( const base::android::JavaRef<jobject>& picture) OVERRIDE; + virtual gfx::Point GetLocationOnScreen() OVERRIDE; void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); void SetPendingWebContentsForPopup(scoped_ptr<content::WebContents> pending); |