| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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" | 71 #include "content/public/common/message_port_types.h" |
| 72 #include "content/public/common/mhtml_generation.h" |
| 72 #include "content/public/common/renderer_preferences.h" | 73 #include "content/public/common/renderer_preferences.h" |
| 73 #include "content/public/common/ssl_status.h" | 74 #include "content/public/common/ssl_status.h" |
| 74 #include "jni/AwContents_jni.h" | 75 #include "jni/AwContents_jni.h" |
| 75 #include "net/base/auth.h" | 76 #include "net/base/auth.h" |
| 76 #include "net/cert/x509_certificate.h" | 77 #include "net/cert/x509_certificate.h" |
| 77 #include "third_party/skia/include/core/SkPicture.h" | 78 #include "third_party/skia/include/core/SkPicture.h" |
| 78 #include "ui/gfx/android/java_bitmap.h" | 79 #include "ui/gfx/android/java_bitmap.h" |
| 79 #include "ui/gfx/geometry/rect_f.h" | 80 #include "ui/gfx/geometry/rect_f.h" |
| 80 #include "ui/gfx/geometry/size.h" | 81 #include "ui/gfx/geometry/size.h" |
| 81 #include "ui/gfx/image/image.h" | 82 #include "ui/gfx/image/image.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 398 |
| 398 void AwContents::GenerateMHTML(JNIEnv* env, | 399 void AwContents::GenerateMHTML(JNIEnv* env, |
| 399 const JavaParamRef<jobject>& obj, | 400 const JavaParamRef<jobject>& obj, |
| 400 const JavaParamRef<jstring>& jpath, | 401 const JavaParamRef<jstring>& jpath, |
| 401 const JavaParamRef<jobject>& callback) { | 402 const JavaParamRef<jobject>& callback) { |
| 402 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 403 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 403 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); | 404 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); |
| 404 j_callback->Reset(env, callback); | 405 j_callback->Reset(env, callback); |
| 405 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); | 406 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); |
| 406 web_contents_->GenerateMHTML( | 407 web_contents_->GenerateMHTML( |
| 407 target_path, | 408 content::MHTMLGenerationParams(target_path), |
| 408 false /* use_binary_encoding */, | |
| 409 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); | 409 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); |
| 410 } | 410 } |
| 411 | 411 |
| 412 void AwContents::CreatePdfExporter(JNIEnv* env, | 412 void AwContents::CreatePdfExporter(JNIEnv* env, |
| 413 const JavaParamRef<jobject>& obj, | 413 const JavaParamRef<jobject>& obj, |
| 414 const JavaParamRef<jobject>& pdfExporter) { | 414 const JavaParamRef<jobject>& pdfExporter) { |
| 415 pdf_exporter_.reset( | 415 pdf_exporter_.reset( |
| 416 new AwPdfExporter(env, | 416 new AwPdfExporter(env, |
| 417 pdfExporter, | 417 pdfExporter, |
| 418 web_contents_.get())); | 418 web_contents_.get())); |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 const JavaParamRef<jobject>& obj) { | 1283 const JavaParamRef<jobject>& obj) { |
| 1284 web_contents_->ResumeLoadingCreatedWebContents(); | 1284 web_contents_->ResumeLoadingCreatedWebContents(); |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 void SetShouldDownloadFavicons(JNIEnv* env, | 1287 void SetShouldDownloadFavicons(JNIEnv* env, |
| 1288 const JavaParamRef<jclass>& jclazz) { | 1288 const JavaParamRef<jclass>& jclazz) { |
| 1289 g_should_download_favicons = true; | 1289 g_should_download_favicons = true; |
| 1290 } | 1290 } |
| 1291 | 1291 |
| 1292 } // namespace android_webview | 1292 } // namespace android_webview |
| OLD | NEW |