| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 #include "content/public/browser/browser_thread.h" | 61 #include "content/public/browser/browser_thread.h" |
| 62 #include "content/public/browser/cert_store.h" | 62 #include "content/public/browser/cert_store.h" |
| 63 #include "content/public/browser/child_process_security_policy.h" | 63 #include "content/public/browser/child_process_security_policy.h" |
| 64 #include "content/public/browser/favicon_status.h" | 64 #include "content/public/browser/favicon_status.h" |
| 65 #include "content/public/browser/message_port_provider.h" | 65 #include "content/public/browser/message_port_provider.h" |
| 66 #include "content/public/browser/navigation_entry.h" | 66 #include "content/public/browser/navigation_entry.h" |
| 67 #include "content/public/browser/render_frame_host.h" | 67 #include "content/public/browser/render_frame_host.h" |
| 68 #include "content/public/browser/render_process_host.h" | 68 #include "content/public/browser/render_process_host.h" |
| 69 #include "content/public/browser/render_view_host.h" | 69 #include "content/public/browser/render_view_host.h" |
| 70 #include "content/public/browser/web_contents.h" | 70 #include "content/public/browser/web_contents.h" |
| 71 #include "content/public/common/message_port_types.h" | |
| 72 #include "content/public/common/renderer_preferences.h" | 71 #include "content/public/common/renderer_preferences.h" |
| 73 #include "content/public/common/ssl_status.h" | 72 #include "content/public/common/ssl_status.h" |
| 74 #include "jni/AwContents_jni.h" | 73 #include "jni/AwContents_jni.h" |
| 75 #include "net/base/auth.h" | 74 #include "net/base/auth.h" |
| 76 #include "net/cert/x509_certificate.h" | 75 #include "net/cert/x509_certificate.h" |
| 77 #include "third_party/skia/include/core/SkPicture.h" | 76 #include "third_party/skia/include/core/SkPicture.h" |
| 78 #include "ui/gfx/android/java_bitmap.h" | 77 #include "ui/gfx/android/java_bitmap.h" |
| 79 #include "ui/gfx/geometry/rect_f.h" | 78 #include "ui/gfx/geometry/rect_f.h" |
| 80 #include "ui/gfx/geometry/size.h" | 79 #include "ui/gfx/geometry/size.h" |
| 81 #include "ui/gfx/image/image.h" | 80 #include "ui/gfx/image/image.h" |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 | 1233 |
| 1235 if (sent_ports != nullptr) { | 1234 if (sent_ports != nullptr) { |
| 1236 base::android::JavaIntArrayToIntVector(env, sent_ports, &j_ports); | 1235 base::android::JavaIntArrayToIntVector(env, sent_ports, &j_ports); |
| 1237 BrowserThread::PostTask( | 1236 BrowserThread::PostTask( |
| 1238 BrowserThread::IO, | 1237 BrowserThread::IO, |
| 1239 FROM_HERE, | 1238 FROM_HERE, |
| 1240 base::Bind(&AwMessagePortServiceImpl::RemoveSentPorts, | 1239 base::Bind(&AwMessagePortServiceImpl::RemoveSentPorts, |
| 1241 base::Unretained(AwMessagePortServiceImpl::GetInstance()), | 1240 base::Unretained(AwMessagePortServiceImpl::GetInstance()), |
| 1242 j_ports)); | 1241 j_ports)); |
| 1243 } | 1242 } |
| 1244 std::vector<content::TransferredMessagePort> ports(j_ports.size()); | |
| 1245 for (size_t i = 0; i < j_ports.size(); ++i) | |
| 1246 ports[i].id = j_ports[i]; | |
| 1247 content::MessagePortProvider::PostMessageToFrame(web_contents_.get(), | 1243 content::MessagePortProvider::PostMessageToFrame(web_contents_.get(), |
| 1248 source_origin, | 1244 source_origin, |
| 1249 j_target_origin, | 1245 j_target_origin, |
| 1250 j_message, | 1246 j_message, |
| 1251 ports); | 1247 j_ports); |
| 1252 } | 1248 } |
| 1253 | 1249 |
| 1254 scoped_refptr<AwMessagePortMessageFilter> | 1250 scoped_refptr<AwMessagePortMessageFilter> |
| 1255 AwContents::GetMessagePortMessageFilter() { | 1251 AwContents::GetMessagePortMessageFilter() { |
| 1256 // Create a message port message filter if necessary | 1252 // Create a message port message filter if necessary |
| 1257 if (message_port_message_filter_.get() == nullptr) { | 1253 if (message_port_message_filter_.get() == nullptr) { |
| 1258 message_port_message_filter_ = | 1254 message_port_message_filter_ = |
| 1259 new AwMessagePortMessageFilter( | 1255 new AwMessagePortMessageFilter( |
| 1260 web_contents_->GetMainFrame()->GetRoutingID()); | 1256 web_contents_->GetMainFrame()->GetRoutingID()); |
| 1261 web_contents_->GetRenderProcessHost()->AddFilter( | 1257 web_contents_->GetRenderProcessHost()->AddFilter( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1283 const JavaParamRef<jobject>& obj) { | 1279 const JavaParamRef<jobject>& obj) { |
| 1284 web_contents_->ResumeLoadingCreatedWebContents(); | 1280 web_contents_->ResumeLoadingCreatedWebContents(); |
| 1285 } | 1281 } |
| 1286 | 1282 |
| 1287 void SetShouldDownloadFavicons(JNIEnv* env, | 1283 void SetShouldDownloadFavicons(JNIEnv* env, |
| 1288 const JavaParamRef<jclass>& jclazz) { | 1284 const JavaParamRef<jclass>& jclazz) { |
| 1289 g_should_download_favicons = true; | 1285 g_should_download_favicons = true; |
| 1290 } | 1286 } |
| 1291 | 1287 |
| 1292 } // namespace android_webview | 1288 } // namespace android_webview |
| OLD | NEW |