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" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "content/browser/android/load_url_params.h" | 14 #include "content/browser/android/load_url_params.h" |
15 #include "content/browser/android/touch_point.h" | 15 #include "content/browser/android/touch_point.h" |
16 #include "content/browser/renderer_host/java/java_bound_object.h" | 16 #include "content/browser/renderer_host/java/java_bound_object.h" |
17 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager
.h" | 17 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager
.h" |
18 #include "content/browser/renderer_host/compositor_impl_android.h" | 18 #include "content/browser/renderer_host/compositor_impl_android.h" |
19 #include "content/browser/renderer_host/render_view_host_impl.h" | 19 #include "content/browser/renderer_host/render_view_host_impl.h" |
20 #include "content/browser/renderer_host/render_widget_host_impl.h" | 20 #include "content/browser/renderer_host/render_widget_host_impl.h" |
21 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 21 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
22 #include "content/browser/ssl/ssl_host_state.h" | 22 #include "content/browser/ssl/ssl_host_state.h" |
| 23 #include "content/browser/web_contents/interstitial_page_impl.h" |
23 #include "content/browser/web_contents/navigation_controller_impl.h" | 24 #include "content/browser/web_contents/navigation_controller_impl.h" |
24 #include "content/browser/web_contents/navigation_entry_impl.h" | 25 #include "content/browser/web_contents/navigation_entry_impl.h" |
25 #include "content/browser/web_contents/web_contents_view_android.h" | 26 #include "content/browser/web_contents/web_contents_view_android.h" |
26 #include "content/common/android/device_info.h" | 27 #include "content/common/android/device_info.h" |
27 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
28 #include "content/public/browser/browser_context.h" | 29 #include "content/public/browser/browser_context.h" |
29 #include "content/public/browser/favicon_status.h" | 30 #include "content/public/browser/favicon_status.h" |
30 #include "content/public/browser/interstitial_page.h" | |
31 #include "content/public/browser/notification_details.h" | 31 #include "content/public/browser/notification_details.h" |
32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/notification_source.h" | 33 #include "content/public/browser/notification_source.h" |
34 #include "content/public/browser/notification_types.h" | 34 #include "content/public/browser/notification_types.h" |
35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
36 #include "content/public/common/content_client.h" | 36 #include "content/public/common/content_client.h" |
37 #include "content/public/common/page_transition_types.h" | 37 #include "content/public/common/page_transition_types.h" |
38 #include "jni/ContentViewCore_jni.h" | 38 #include "jni/ContentViewCore_jni.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
(...skipping 190 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 = static_cast<InterstitialPageImpl*>( |
| 245 web_contents_->GetInterstitialPage())-> |
| 246 GetRenderViewHost()->GetView(); |
| 247 } |
| 248 } |
243 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); | 249 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); |
244 } | 250 } |
245 | 251 |
246 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { | 252 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { |
247 JNIEnv* env = AttachCurrentThread(); | 253 JNIEnv* env = AttachCurrentThread(); |
248 return java_ref_.get(env); | 254 return java_ref_.get(env); |
249 } | 255 } |
250 | 256 |
251 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContainerViewDelegate() { | 257 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContainerViewDelegate() { |
252 JNIEnv* env = AttachCurrentThread(); | 258 JNIEnv* env = AttachCurrentThread(); |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1102 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
1097 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1103 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
1098 return false; | 1104 return false; |
1099 } | 1105 } |
1100 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1106 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
1101 | 1107 |
1102 return RegisterNativesImpl(env) >= 0; | 1108 return RegisterNativesImpl(env) >= 0; |
1103 } | 1109 } |
1104 | 1110 |
1105 } // namespace content | 1111 } // namespace content |
OLD | NEW |