| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Turn a dictionary received from postMessage into a key event. | 6 * Turn a dictionary received from postMessage into a key event. |
| 7 * @param {Object} dict A dictionary representing the key event. | 7 * @param {Object} dict A dictionary representing the key event. |
| 8 * @return {Event} A key event. | 8 * @return {Event} A key event. |
| 9 */ | 9 */ |
| 10 function DeserializeKeyEvent(dict) { | 10 function DeserializeKeyEvent(dict) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 * @param {Function} callback the callback to be called with a key event. | 144 * @param {Function} callback the callback to be called with a key event. |
| 145 */ | 145 */ |
| 146 setKeyEventCallback: function(callback) { | 146 setKeyEventCallback: function(callback) { |
| 147 this.keyEventCallback_ = callback; | 147 this.keyEventCallback_ = callback; |
| 148 }, | 148 }, |
| 149 | 149 |
| 150 /** | 150 /** |
| 151 * Resets the PDF viewer into print preview mode. | 151 * Resets the PDF viewer into print preview mode. |
| 152 * @param {string} url the url of the PDF to load. | 152 * @param {string} url the url of the PDF to load. |
| 153 * @param {boolean} grayscale whether or not to display the PDF in grayscale. | 153 * @param {boolean} grayscale whether or not to display the PDF in grayscale. |
| 154 * @param {Array.<number>} pageNumbers an array of the page numbers. | 154 * @param {Array<number>} pageNumbers an array of the page numbers. |
| 155 * @param {boolean} modifiable whether or not the document is modifiable. | 155 * @param {boolean} modifiable whether or not the document is modifiable. |
| 156 */ | 156 */ |
| 157 resetPrintPreviewMode: function(url, grayscale, pageNumbers, modifiable) { | 157 resetPrintPreviewMode: function(url, grayscale, pageNumbers, modifiable) { |
| 158 this.loaded_ = false; | 158 this.loaded_ = false; |
| 159 this.sendMessage_({ | 159 this.sendMessage_({ |
| 160 type: 'resetPrintPreviewMode', | 160 type: 'resetPrintPreviewMode', |
| 161 url: url, | 161 url: url, |
| 162 grayscale: grayscale, | 162 grayscale: grayscale, |
| 163 pageNumbers: pageNumbers, | 163 pageNumbers: pageNumbers, |
| 164 modifiable: modifiable | 164 modifiable: modifiable |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // Add the functions to the iframe so that they can be called directly. | 272 // Add the functions to the iframe so that they can be called directly. |
| 273 iframe.setViewportChangedCallback = | 273 iframe.setViewportChangedCallback = |
| 274 client.setViewportChangedCallback.bind(client); | 274 client.setViewportChangedCallback.bind(client); |
| 275 iframe.setLoadCallback = client.setLoadCallback.bind(client); | 275 iframe.setLoadCallback = client.setLoadCallback.bind(client); |
| 276 iframe.setKeyEventCallback = client.setKeyEventCallback.bind(client); | 276 iframe.setKeyEventCallback = client.setKeyEventCallback.bind(client); |
| 277 iframe.resetPrintPreviewMode = client.resetPrintPreviewMode.bind(client); | 277 iframe.resetPrintPreviewMode = client.resetPrintPreviewMode.bind(client); |
| 278 iframe.loadPreviewPage = client.loadPreviewPage.bind(client); | 278 iframe.loadPreviewPage = client.loadPreviewPage.bind(client); |
| 279 iframe.sendKeyEvent = client.sendKeyEvent.bind(client); | 279 iframe.sendKeyEvent = client.sendKeyEvent.bind(client); |
| 280 return iframe; | 280 return iframe; |
| 281 } | 281 } |
| OLD | NEW |