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

Unified Diff: android_webview/native/aw_pdf_exporter.cc

Issue 854513002: Remove the discrepencies between chrome and android_webview print (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_pdf_exporter.cc
diff --git a/android_webview/native/aw_pdf_exporter.cc b/android_webview/native/aw_pdf_exporter.cc
index 8da47a0733c416b5a67e939aa808ddd3ed120e7e..0e888c246e8032a2ee261fb69a350c6c6b5929fb 100644
--- a/android_webview/native/aw_pdf_exporter.cc
+++ b/android_webview/native/aw_pdf_exporter.cc
@@ -4,7 +4,6 @@
#include "android_webview/native/aw_pdf_exporter.h"
-#include "android_webview/browser/renderer_host/print_manager.h"
hush (inactive) 2015/01/14 01:55:47 we still need print manager in this file?
sgurun-gerrit only 2015/01/14 02:03:17 aw_pdf_exporter.h includes it since it implements
#include "base/android/jni_android.h"
#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
@@ -48,9 +47,13 @@ void AwPdfExporter::ExportToPdf(JNIEnv* env,
jobject cancel_signal) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CreatePdfSettings(env, obj);
- print_manager_.reset(
- new PrintManager(web_contents_, print_settings_.get(), fd, this));
- if (!print_manager_->PrintNow())
+ PrintManager* print_manager =
+ PrintManager::CreateForWebContents(
+ web_contents_, print_settings_.get(), fd, this);
+ print_manager =
boliu 2015/01/14 01:41:02 Why call CreateForWebContents with the exact same
hush (inactive) 2015/01/14 01:55:47 print_manager is assigned 2 times?
sgurun-gerrit only 2015/01/14 02:03:17 Done.
sgurun-gerrit only 2015/01/14 02:03:17 Done.
+ PrintManager::CreateForWebContents(
+ web_contents_, print_settings_.get(), fd, this);
+ if (!print_manager->PrintNow())
DidExportPdf(false);
}

Powered by Google App Engine
This is Rietveld 408576698