| Index: chrome/browser/resources/pdf/pdf_scripting_api.js
|
| diff --git a/chrome/browser/resources/pdf/pdf_scripting_api.js b/chrome/browser/resources/pdf/pdf_scripting_api.js
|
| index 8b0b9d5c0a74119b67b67a22d8bb9945efb29613..64c5059360d15fe9782fb20d44934343e1cb2cb8 100644
|
| --- a/chrome/browser/resources/pdf/pdf_scripting_api.js
|
| +++ b/chrome/browser/resources/pdf/pdf_scripting_api.js
|
| @@ -7,6 +7,7 @@
|
| * the PDF viewer so that it can be customized by things like print preview.
|
| * @param {Window} window the window of the page containing the pdf viewer.
|
| * @param {string} extensionUrl the url of the PDF extension.
|
| + * @constructor
|
| */
|
| function PDFScriptingAPI(window, extensionUrl) {
|
| this.extensionUrl_ = extensionUrl;
|
| @@ -22,6 +23,13 @@ function PDFScriptingAPI(window, extensionUrl) {
|
| this.setDestinationWindow(event.source);
|
| break;
|
| case 'viewport':
|
| + event.data = /**
|
| + * @type {{pageX: number,
|
| + * pageY: number,
|
| + * pageWidth: number,
|
| + * viewportWidth: number,
|
| + * viewportHeight: number}}
|
| + */(event.data);
|
| if (this.viewportChangedCallback_)
|
| this.viewportChangedCallback_(event.data.pageX,
|
| event.data.pageY,
|
| @@ -35,6 +43,7 @@ function PDFScriptingAPI(window, extensionUrl) {
|
| break;
|
| case 'getAccessibilityJSONReply':
|
| if (this.accessibilityCallback_) {
|
| + event.data = /** @type {{json: string}} */(event.data);
|
| this.accessibilityCallback_(event.data.json);
|
| this.accessibilityCallback_ = null;
|
| }
|
| @@ -166,7 +175,8 @@ PDFScriptingAPI.prototype = {
|
| */
|
| function PDFCreateOutOfProcessPlugin(src) {
|
| var EXTENSION_URL = 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai';
|
| - var iframe = window.document.createElement('iframe');
|
| + var iframe = assertInstanceof(window.document.createElement('iframe'),
|
| + HTMLIFrameElement);
|
| iframe.setAttribute('src', EXTENSION_URL + '/index.html?' + src);
|
| var client = new PDFScriptingAPI(window, EXTENSION_URL);
|
|
|
|
|