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

Unified Diff: content/browser/web_contents/web_contents_android.cc

Issue 2671623002: Expose WindowAndroid from WebContents. (Closed)
Patch Set: Created 3 years, 11 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/web_contents/web_contents_android.cc
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
index 412213d1be94836d1502d3bf05a125b6f8dcee25..968be1ee4b1dad293606ab2c840fda8ec194ffa4 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -40,6 +40,7 @@
#include "net/android/network_library.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/android/overscroll_refresh_handler.h"
+#include "ui/android/window_android.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/geometry/rect.h"
@@ -276,6 +277,15 @@ WebContentsAndroid::GetJavaObject() {
return base::android::ScopedJavaLocalRef<jobject>(obj_);
}
+base::android::ScopedJavaLocalRef<jobject>
+WebContentsAndroid::GetTopLevelNativeWindow(JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ ui::WindowAndroid* window_android = web_contents_->GetTopLevelNativeWindow();
+ if (!window_android)
+ return ScopedJavaLocalRef<jobject>();
boliu 2017/02/02 03:34:00 nullptr should work
Ted C 2017/03/03 20:55:26 Done.
+ return window_android->GetJavaObject();
+}
+
ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle(
JNIEnv* env,
const JavaParamRef<jobject>& obj) const {

Powered by Google App Engine
This is Rietveld 408576698