Merge "Provide an API to set print document name."

This commit is contained in:
Selim Gurun
2014-04-18 14:49:25 +00:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 6 deletions

View File

@@ -32735,7 +32735,8 @@ package android.webkit {
method public void clearSslPreferences();
method public deprecated void clearView();
method public android.webkit.WebBackForwardList copyBackForwardList();
method public android.print.PrintDocumentAdapter createPrintDocumentAdapter();
method public deprecated android.print.PrintDocumentAdapter createPrintDocumentAdapter();
method public android.print.PrintDocumentAdapter createPrintDocumentAdapter(java.lang.String);
method public void destroy();
method public void documentHasImages(android.os.Message);
method public void evaluateJavascript(java.lang.String, android.webkit.ValueCallback<java.lang.String>);

View File

@@ -1135,10 +1135,19 @@ public class WebView extends AbsoluteLayout
return mProvider.capturePicture();
}
/**
* @deprecated Use {@link #createPrintDocumentAdapter(String)} which requires user
* to provide a print document name.
*/
@Deprecated
public PrintDocumentAdapter createPrintDocumentAdapter() {
checkThread();
if (DebugFlags.TRACE_API) Log.d(LOGTAG, "createPrintDocumentAdapter");
return mProvider.createPrintDocumentAdapter("default");
}
/**
* Creates a PrintDocumentAdapter that provides the content of this Webview for printing.
* Only supported for API levels
* {@link android.os.Build.VERSION_CODES#KITKAT} and above.
*
* The adapter works by converting the Webview contents to a PDF stream. The Webview cannot
* be drawn during the conversion process - any such draws are undefined. It is recommended
@@ -1146,11 +1155,14 @@ public class WebView extends AbsoluteLayout
* temporarily hide a visible WebView by using a custom PrintDocumentAdapter instance
* wrapped around the object returned and observing the onStart and onFinish methods. See
* {@link android.print.PrintDocumentAdapter} for more information.
*
* @param documentName The user-facing name of the printed document. See
* {@link android.print.PrintDocumentInfo}
*/
public PrintDocumentAdapter createPrintDocumentAdapter() {
public PrintDocumentAdapter createPrintDocumentAdapter(String documentName) {
checkThread();
if (DebugFlags.TRACE_API) Log.d(LOGTAG, "createPrintDocumentAdapter");
return mProvider.createPrintDocumentAdapter();
return mProvider.createPrintDocumentAdapter(documentName);
}
/**

View File

@@ -148,7 +148,7 @@ public interface WebViewProvider {
public Picture capturePicture();
public PrintDocumentAdapter createPrintDocumentAdapter();
public PrintDocumentAdapter createPrintDocumentAdapter(String documentName);
public float getScale();