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

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

Issue 2671623002: Expose WindowAndroid from WebContents. (Closed)
Patch Set: Rebase Created 3 years, 10 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 842b860337c64cfd48970e683a8bce5ef33d700b..a93fad88c15d0d4ce70b90c16d81ef9332fe13f6 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -39,6 +39,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"
@@ -284,6 +285,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 nullptr;
+ return window_android->GetJavaObject();
+}
+
ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle(
JNIEnv* env,
const JavaParamRef<jobject>& obj) const {

Powered by Google App Engine
This is Rietveld 408576698