summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authorsgurun@chromium.org <sgurun@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 22:28:14 +0000
committersgurun@chromium.org <sgurun@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 22:28:14 +0000
commit1d2d38ea87fd58e3946f4127af13a1c746a1f08c (patch)
treee2ac5f622cae84fa75f1b19dac494c866ba9677b /android_webview
parent57482a754763b11a9d8f1fa2fe5329f338e6b17a (diff)
downloadchromium_src-1d2d38ea87fd58e3946f4127af13a1c746a1f08c.zip
chromium_src-1d2d38ea87fd58e3946f4127af13a1c746a1f08c.tar.gz
chromium_src-1d2d38ea87fd58e3946f4127af13a1c746a1f08c.tar.bz2
Plumb document name to printdocumentadapter.
BUG=b/13250097 Review URL: https://codereview.chromium.org/198503003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java b/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java
index ced696c..a3ad246 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java
@@ -23,24 +23,37 @@ public class AwPrintDocumentAdapter extends PrintDocumentAdapter {
private AwPdfExporter mPdfExporter;
private PrintAttributes mAttributes;
+ private String mDocumentName;
/**
* Constructor.
+ * TODO(sgurun) remove in favor of constructor below once the AOSP changes are in.
*
* @param pdfExporter The PDF exporter to export the webview contents to a PDF file.
*/
public AwPrintDocumentAdapter(AwPdfExporter pdfExporter) {
+ this(pdfExporter, "default");
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param pdfExporter The PDF exporter to export the webview contents to a PDF file.
+ * @param documentName The name of the pdf document.
+ */
+ public AwPrintDocumentAdapter(AwPdfExporter pdfExporter, String documentName) {
mPdfExporter = pdfExporter;
+ mDocumentName = documentName;
}
+
@Override
public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes,
CancellationSignal cancellationSignal, LayoutResultCallback callback,
Bundle metadata) {
mAttributes = newAttributes;
- // TODO(sgurun) pass a meaningful string once b/10705082 is resolved
PrintDocumentInfo documentInfo = new PrintDocumentInfo
- .Builder("webview")
+ .Builder(mDocumentName)
.build();
// TODO(sgurun) once componentization is done, do layout changes and
// generate PDF here, set the page range information to documentinfo