Enable webview printing

Bug: 10288759

Klp-XX branches already have printing support. This is to add
printing to master. Depends on crrev.com/54963005

The original change was 412d84be859ce0eb91baf2f9afe5e6326a15d76a

Change-Id: Ia2d0685b7fd01e1251aed2e4a673d2544d47bba5
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromium.java b/chromium/java/com/android/webview/chromium/WebViewChromium.java
index beae322..6c5ee7a 100644
--- a/chromium/java/com/android/webview/chromium/WebViewChromium.java
+++ b/chromium/java/com/android/webview/chromium/WebViewChromium.java
@@ -59,6 +59,7 @@
 import org.chromium.android_webview.AwContents;
 import org.chromium.android_webview.AwLayoutSizer;
 import org.chromium.android_webview.AwSettings;
+import org.chromium.android_webview.AwPrintDocumentAdapter;
 import org.chromium.base.ThreadUtils;
 import org.chromium.content.browser.LoadUrlParams;
 import org.chromium.net.NetworkChangeNotifier;
@@ -834,13 +835,6 @@
     }
 
     @Override
-    public PrintDocumentAdapter createPrintDocumentAdapter() {
-        checkThread();
-        // TODO(sgurun) fix this after upstream part lands
-        return null;
-    }
-
-    @Override
     public float getScale() {
         // No checkThread() as it is mostly thread safe (workaround for b/10652991).
         mFactory.startYourEngines(true);
@@ -2033,6 +2027,12 @@
         mAwContents.computeScroll();
     }
 
+    @Override
+    public PrintDocumentAdapter createPrintDocumentAdapter() {
+        checkThread();
+        return new AwPrintDocumentAdapter(mAwContents.getPdfExporter());
+    }
+
     // AwContents.InternalAccessDelegate implementation --------------------------------------
     private class InternalAccessAdapter implements AwContents.InternalAccessDelegate {
         @Override