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