| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @return {number} Width of a scrollbar in pixels | 8 * @return {number} Width of a scrollbar in pixels |
| 9 */ | 9 */ |
| 10 function getScrollbarWidth() { | 10 function getScrollbarWidth() { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 e.preventDefault(); | 227 e.preventDefault(); |
| 228 } | 228 } |
| 229 return; | 229 return; |
| 230 case 80: // p key. | 230 case 80: // p key. |
| 231 if (e.ctrlKey || e.metaKey) { | 231 if (e.ctrlKey || e.metaKey) { |
| 232 this.print_(); | 232 this.print_(); |
| 233 // Since we do the printing of the page. | 233 // Since we do the printing of the page. |
| 234 e.preventDefault(); | 234 e.preventDefault(); |
| 235 } | 235 } |
| 236 return; | 236 return; |
| 237 case 219: // left bracket. |
| 238 this.plugin_.postMessage({ |
| 239 type: 'rotateCounterclockwise', |
| 240 }); |
| 241 return; |
| 242 case 221: // right bracket. |
| 243 this.plugin_.postMessage({ |
| 244 type: 'rotateClockwise', |
| 245 }); |
| 246 return; |
| 237 } | 247 } |
| 238 }, | 248 }, |
| 239 | 249 |
| 240 /** | 250 /** |
| 241 * @private | 251 * @private |
| 242 * Notify the plugin to print. | 252 * Notify the plugin to print. |
| 243 */ | 253 */ |
| 244 print_: function() { | 254 print_: function() { |
| 245 this.plugin_.postMessage({ | 255 this.plugin_.postMessage({ |
| 246 type: 'print', | 256 type: 'print', |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 window.parent.postMessage(message, '*'); | 552 window.parent.postMessage(message, '*'); |
| 543 }, | 553 }, |
| 544 | 554 |
| 545 /** | 555 /** |
| 546 * @type {Viewport} the viewport of the PDF viewer. | 556 * @type {Viewport} the viewport of the PDF viewer. |
| 547 */ | 557 */ |
| 548 get viewport() { | 558 get viewport() { |
| 549 return this.viewport_; | 559 return this.viewport_; |
| 550 } | 560 } |
| 551 }; | 561 }; |
| OLD | NEW |