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

Unified Diff: android_webview/browser/aw_pdf_exporter.cc

Issue 2863233002: [WebView] Move files from native to browser (Closed)
Patch Set: Created 3 years, 7 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/browser/aw_pdf_exporter.cc
diff --git a/android_webview/native/aw_pdf_exporter.cc b/android_webview/browser/aw_pdf_exporter.cc
similarity index 84%
rename from android_webview/native/aw_pdf_exporter.cc
rename to android_webview/browser/aw_pdf_exporter.cc
index 2197a3e0461c402ca82681281a32e7de998e75d0..6ba16f5dc0e4510c916833c84f63e406de5a19d9 100644
--- a/android_webview/native/aw_pdf_exporter.cc
+++ b/android_webview/browser/aw_pdf_exporter.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "android_webview/native/aw_pdf_exporter.h"
+#include "android_webview/browser/aw_pdf_exporter.h"
#include "android_webview/browser/aw_print_manager.h"
#include "base/android/jni_android.h"
@@ -40,8 +40,8 @@ AwPdfExporter::AwPdfExporter(JNIEnv* env,
content::WebContents* web_contents)
: java_ref_(env, obj), web_contents_(web_contents) {
DCHECK(!obj.is_null());
- Java_AwPdfExporter_setNativeAwPdfExporter(
- env, obj, reinterpret_cast<intptr_t>(this));
+ Java_AwPdfExporter_setNativeAwPdfExporter(env, obj,
+ reinterpret_cast<intptr_t>(this));
}
AwPdfExporter::~AwPdfExporter() {
@@ -63,10 +63,9 @@ void AwPdfExporter::ExportToPdf(JNIEnv* env,
printing::PageRanges page_ranges;
GetPageRanges(env, pages, &page_ranges);
InitPdfSettings(env, obj, page_ranges, print_settings);
- AwPrintManager* print_manager =
- AwPrintManager::CreateForWebContents(
- web_contents_, print_settings, base::FileDescriptor(fd, false),
- base::Bind(&AwPdfExporter::DidExportPdf, base::Unretained(this)));
+ AwPrintManager* print_manager = AwPrintManager::CreateForWebContents(
+ web_contents_, print_settings, base::FileDescriptor(fd, false),
+ base::Bind(&AwPdfExporter::DidExportPdf, base::Unretained(this)));
if (!print_manager->PrintNow())
DidExportPdf(fd, false);
@@ -102,16 +101,12 @@ void AwPdfExporter::InitPdfSettings(JNIEnv* env,
// TODO(sgurun) verify that the value for newly added parameter for
// (i.e. landscape_needs_flip) is correct.
settings.SetPrinterPrintableArea(physical_size_device_units,
- printable_area_device_units,
- true);
+ printable_area_device_units, true);
printing::PageMargins margins;
- margins.left =
- MilsToDots(Java_AwPdfExporter_getLeftMargin(env, obj), dpi);
- margins.right =
- MilsToDots(Java_AwPdfExporter_getRightMargin(env, obj), dpi);
- margins.top =
- MilsToDots(Java_AwPdfExporter_getTopMargin(env, obj), dpi);
+ margins.left = MilsToDots(Java_AwPdfExporter_getLeftMargin(env, obj), dpi);
+ margins.right = MilsToDots(Java_AwPdfExporter_getRightMargin(env, obj), dpi);
+ margins.top = MilsToDots(Java_AwPdfExporter_getTopMargin(env, obj), dpi);
margins.bottom =
MilsToDots(Java_AwPdfExporter_getBottomMargin(env, obj), dpi);
settings.SetCustomMargins(margins);

Powered by Google App Engine
This is Rietveld 408576698