Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 22920005: Refactor MHTMLGenerator to allow getting sending the data to a file descriptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/page_capture/page_capture_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h"
10 #include "android_webview/browser/in_process_view_renderer.h" 10 #include "android_webview/browser/in_process_view_renderer.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 env, 295 env,
296 ConvertUTF8ToJavaString(env, path.AsUTF8Unsafe()).obj(), 296 ConvertUTF8ToJavaString(env, path.AsUTF8Unsafe()).obj(),
297 size, callback->obj()); 297 size, callback->obj());
298 } 298 }
299 } // namespace 299 } // namespace
300 300
301 void AwContents::GenerateMHTML(JNIEnv* env, jobject obj, 301 void AwContents::GenerateMHTML(JNIEnv* env, jobject obj,
302 jstring jpath, jobject callback) { 302 jstring jpath, jobject callback) {
303 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); 303 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
304 j_callback->Reset(env, callback); 304 j_callback->Reset(env, callback);
305 web_contents_->GenerateMHTML( 305 base::FilePath target_path(ConvertJavaStringToUTF8(env, jpath));
306 base::FilePath(ConvertJavaStringToUTF8(env, jpath)), 306 web_contents_->SaveMHTML(
307 base::Bind(&GenerateMHTMLCallback, base::Owned(j_callback))); 307 target_path,
308 base::Bind(&GenerateMHTMLCallback, path, base::Owned(j_callback)));
mkosiba (inactive) 2013/08/28 10:34:37 looks like this should be taget_path instead of pa
qsr 2013/08/28 11:21:33 Yep... Thanks and done.
308 } 309 }
309 310
310 void AwContents::PerformLongClick() { 311 void AwContents::PerformLongClick() {
311 JNIEnv* env = AttachCurrentThread(); 312 JNIEnv* env = AttachCurrentThread();
312 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 313 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
313 if (obj.is_null()) 314 if (obj.is_null())
314 return; 315 return;
315 316
316 Java_AwContents_performLongClick(env, obj.obj()); 317 Java_AwContents_performLongClick(env, obj.obj());
317 } 318 }
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 browser_view_renderer_->CapturePicture(width, height))); 775 browser_view_renderer_->CapturePicture(width, height)));
775 } 776 }
776 777
777 void AwContents::EnableOnNewPicture(JNIEnv* env, 778 void AwContents::EnableOnNewPicture(JNIEnv* env,
778 jobject obj, 779 jobject obj,
779 jboolean enabled) { 780 jboolean enabled) {
780 browser_view_renderer_->EnableOnNewPicture(enabled); 781 browser_view_renderer_->EnableOnNewPicture(enabled);
781 } 782 }
782 783
783 } // namespace android_webview 784 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/page_capture/page_capture_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698