| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. | 237 case 219: // left bracket. |
| 238 this.plugin_.postMessage({ | 238 if (e.ctrlKey) { |
| 239 type: 'rotateCounterclockwise', | 239 this.plugin_.postMessage({ |
| 240 }); | 240 type: 'rotateCounterclockwise', |
| 241 }); |
| 242 } |
| 241 return; | 243 return; |
| 242 case 221: // right bracket. | 244 case 221: // right bracket. |
| 243 this.plugin_.postMessage({ | 245 if (e.ctrlKey) { |
| 244 type: 'rotateClockwise', | 246 this.plugin_.postMessage({ |
| 245 }); | 247 type: 'rotateClockwise', |
| 248 }); |
| 249 } |
| 246 return; | 250 return; |
| 247 } | 251 } |
| 248 }, | 252 }, |
| 249 | 253 |
| 250 /** | 254 /** |
| 251 * @private | 255 * @private |
| 252 * Notify the plugin to print. | 256 * Notify the plugin to print. |
| 253 */ | 257 */ |
| 254 print_: function() { | 258 print_: function() { |
| 255 this.plugin_.postMessage({ | 259 this.plugin_.postMessage({ |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 window.parent.postMessage(message, '*'); | 556 window.parent.postMessage(message, '*'); |
| 553 }, | 557 }, |
| 554 | 558 |
| 555 /** | 559 /** |
| 556 * @type {Viewport} the viewport of the PDF viewer. | 560 * @type {Viewport} the viewport of the PDF viewer. |
| 557 */ | 561 */ |
| 558 get viewport() { | 562 get viewport() { |
| 559 return this.viewport_; | 563 return this.viewport_; |
| 560 } | 564 } |
| 561 }; | 565 }; |
| OLD | NEW |