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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 14018004: [Android] Refactor NativeView to be able to use it for AutofillDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 204145c773647024dade3629fe31daaf9bc4fbd1..ca84d0f3524ad911282ae664a1a601e8286dfabb 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -45,6 +45,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/android/WebInputEventFactory.h"
+#include "ui/android/view_android.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/android/window_android.h"
#include "ui/gfx/screen.h"
@@ -152,6 +153,7 @@ ContentViewCoreImpl::ContentViewCoreImpl(JNIEnv* env, jobject obj,
bool hardware_accelerated,
bool input_events_delivered_at_vsync,
WebContents* web_contents,
+ ui::ViewAndroid* view_android,
ui::WindowAndroid* window_android)
: java_ref_(env, obj),
web_contents_(static_cast<WebContentsImpl*>(web_contents)),
@@ -159,6 +161,7 @@ ContentViewCoreImpl::ContentViewCoreImpl(JNIEnv* env, jobject obj,
tab_crashed_(false),
input_events_delivered_at_vsync_(input_events_delivered_at_vsync),
renderer_frame_pending_(false),
+ view_android_(view_android),
window_android_(window_android) {
CHECK(web_contents) <<
"A ContentViewCoreImpl should be created with a valid WebContents.";
@@ -300,14 +303,6 @@ ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() {
return java_ref_.get(env);
}
-ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContainerViewDelegate() {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
- if (obj.is_null())
- return ScopedJavaLocalRef<jobject>();
- return Java_ContentViewCore_getContainerViewDelegate(env, obj.obj());
-}
-
void ContentViewCoreImpl::OnWebPreferencesUpdated() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
@@ -677,6 +672,10 @@ void ContentViewCoreImpl::LoadUrl(
tab_crashed_ = false;
}
+ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
+ return view_android_;
+}
+
ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const {
return window_android_;
}
@@ -1473,10 +1472,12 @@ jint Init(JNIEnv* env, jobject obj,
jboolean input_events_delivered_at_vsync,
jboolean hardware_accelerated,
jint native_web_contents,
+ jint native_view,
jint native_window) {
ContentViewCoreImpl* view = new ContentViewCoreImpl(
env, obj, input_events_delivered_at_vsync, hardware_accelerated,
reinterpret_cast<WebContents*>(native_web_contents),
+ reinterpret_cast<ui::ViewAndroid*>(native_view),
reinterpret_cast<ui::WindowAndroid*>(native_window));
return reinterpret_cast<jint>(view);
}

Powered by Google App Engine
This is Rietveld 408576698