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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 void AwContents::GenerateMHTML(JNIEnv* env, | 404 void AwContents::GenerateMHTML(JNIEnv* env, |
405 const JavaParamRef<jobject>& obj, | 405 const JavaParamRef<jobject>& obj, |
406 const JavaParamRef<jstring>& jpath, | 406 const JavaParamRef<jstring>& jpath, |
407 const JavaParamRef<jobject>& callback) { | 407 const JavaParamRef<jobject>& callback) { |
408 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 408 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
409 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); | 409 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); |
410 j_callback->Reset(env, callback); | 410 j_callback->Reset(env, callback); |
411 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); | 411 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath)); |
412 web_contents_->GenerateMHTML( | 412 web_contents_->GenerateMHTML( |
413 target_path, | 413 target_path, |
| 414 false /* use_binary_encoding */, |
414 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); | 415 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback), target_path)); |
415 } | 416 } |
416 | 417 |
417 void AwContents::CreatePdfExporter(JNIEnv* env, | 418 void AwContents::CreatePdfExporter(JNIEnv* env, |
418 const JavaParamRef<jobject>& obj, | 419 const JavaParamRef<jobject>& obj, |
419 const JavaParamRef<jobject>& pdfExporter) { | 420 const JavaParamRef<jobject>& pdfExporter) { |
420 pdf_exporter_.reset( | 421 pdf_exporter_.reset( |
421 new AwPdfExporter(env, | 422 new AwPdfExporter(env, |
422 pdfExporter, | 423 pdfExporter, |
423 web_contents_.get())); | 424 web_contents_.get())); |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 const JavaParamRef<jobject>& obj) { | 1293 const JavaParamRef<jobject>& obj) { |
1293 web_contents_->ResumeLoadingCreatedWebContents(); | 1294 web_contents_->ResumeLoadingCreatedWebContents(); |
1294 } | 1295 } |
1295 | 1296 |
1296 void SetShouldDownloadFavicons(JNIEnv* env, | 1297 void SetShouldDownloadFavicons(JNIEnv* env, |
1297 const JavaParamRef<jclass>& jclazz) { | 1298 const JavaParamRef<jclass>& jclazz) { |
1298 g_should_download_favicons = true; | 1299 g_should_download_favicons = true; |
1299 } | 1300 } |
1300 | 1301 |
1301 } // namespace android_webview | 1302 } // namespace android_webview |
OLD | NEW |