| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 void ContentViewCoreImpl::InitJNI(JNIEnv* env, jobject obj) { | 231 void ContentViewCoreImpl::InitJNI(JNIEnv* env, jobject obj) { |
| 232 java_object_ = new JavaObject; | 232 java_object_ = new JavaObject; |
| 233 java_object_->rect_clazz.Reset(GetClass(env, "android/graphics/Rect")); | 233 java_object_->rect_clazz.Reset(GetClass(env, "android/graphics/Rect")); |
| 234 java_object_->rect_constructor = MethodID::Get<MethodID::TYPE_INSTANCE>( | 234 java_object_->rect_constructor = MethodID::Get<MethodID::TYPE_INSTANCE>( |
| 235 env, java_object_->rect_clazz.obj(), "<init>", "(IIII)V"); | 235 env, java_object_->rect_clazz.obj(), "<init>", "(IIII)V"); |
| 236 } | 236 } |
| 237 | 237 |
| 238 RenderWidgetHostViewAndroid* | 238 RenderWidgetHostViewAndroid* |
| 239 ContentViewCoreImpl::GetRenderWidgetHostViewAndroid() { | 239 ContentViewCoreImpl::GetRenderWidgetHostViewAndroid() { |
| 240 RenderWidgetHostView* rwhv = NULL; | 240 RenderWidgetHostView* rwhv = NULL; |
| 241 if (web_contents_) | 241 if (web_contents_) { |
| 242 rwhv = web_contents_->GetRenderWidgetHostView(); | 242 rwhv = web_contents_->GetRenderWidgetHostView(); |
| 243 if (web_contents_->ShowingInterstitialPage()) { |
| 244 rwhv = web_contents_->GetInterstitialPage()-> |
| 245 GetRenderViewHost()->GetView(); |
| 246 } |
| 247 } |
| 243 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); | 248 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); |
| 244 } | 249 } |
| 245 | 250 |
| 246 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { | 251 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { |
| 247 JNIEnv* env = AttachCurrentThread(); | 252 JNIEnv* env = AttachCurrentThread(); |
| 248 return java_ref_.get(env); | 253 return java_ref_.get(env); |
| 249 } | 254 } |
| 250 | 255 |
| 251 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContainerViewDelegate() { | 256 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContainerViewDelegate() { |
| 252 JNIEnv* env = AttachCurrentThread(); | 257 JNIEnv* env = AttachCurrentThread(); |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1101 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
| 1097 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1102 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
| 1098 return false; | 1103 return false; |
| 1099 } | 1104 } |
| 1100 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1105 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
| 1101 | 1106 |
| 1102 return RegisterNativesImpl(env) >= 0; | 1107 return RegisterNativesImpl(env) >= 0; |
| 1103 } | 1108 } |
| 1104 | 1109 |
| 1105 } // namespace content | 1110 } // namespace content |
| OLD | NEW |