| 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..0c17e75128bf45aeb4ca9cdfa2c9254182f89689 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,12 @@ void ContentViewCoreImpl::LoadUrl(
|
| tab_crashed_ = false;
|
| }
|
|
|
| +ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
|
| + // view_android_ should never be null for Chrome.
|
| + DCHECK(view_android_);
|
| + return view_android_;
|
| +}
|
| +
|
| ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const {
|
| return window_android_;
|
| }
|
| @@ -1473,11 +1474,13 @@ jint Init(JNIEnv* env, jobject obj,
|
| jboolean input_events_delivered_at_vsync,
|
| jboolean hardware_accelerated,
|
| jint native_web_contents,
|
| - jint native_window) {
|
| + jint view_android,
|
| + jint window_android) {
|
| ContentViewCoreImpl* view = new ContentViewCoreImpl(
|
| env, obj, input_events_delivered_at_vsync, hardware_accelerated,
|
| reinterpret_cast<WebContents*>(native_web_contents),
|
| - reinterpret_cast<ui::WindowAndroid*>(native_window));
|
| + reinterpret_cast<ui::ViewAndroid*>(view_android),
|
| + reinterpret_cast<ui::WindowAndroid*>(window_android));
|
| return reinterpret_cast<jint>(view);
|
| }
|
|
|
|
|