Chromium Code Reviews| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 position.x += Viewport.SCROLL_INCREMENT; | 211 position.x += Viewport.SCROLL_INCREMENT; |
| 212 this.viewport.position = position; | 212 this.viewport.position = position; |
| 213 } | 213 } |
| 214 return; | 214 return; |
| 215 case 40: // Down arrow key. | 215 case 40: // Down arrow key. |
| 216 if (fromScriptingAPI) { | 216 if (fromScriptingAPI) { |
| 217 position.y += Viewport.SCROLL_INCREMENT; | 217 position.y += Viewport.SCROLL_INCREMENT; |
| 218 this.viewport.position = position; | 218 this.viewport.position = position; |
| 219 } | 219 } |
| 220 return; | 220 return; |
| 221 case 65: // a key. | |
| 222 if (e.ctrlKey) { | |
|
raymes
2014/10/02 14:18:56
Should be e.ctrlKey || e.metaKey
Deepak
2014/10/02 14:57:34
Done.
| |
| 223 this.plugin_.postMessage({ | |
| 224 type: 'selectAll', | |
| 225 }); | |
| 226 } | |
| 227 return; | |
| 221 case 83: // s key. | 228 case 83: // s key. |
| 222 if (e.ctrlKey || e.metaKey) { | 229 if (e.ctrlKey || e.metaKey) { |
| 223 // Simulate a click on the button so that the <a download ...> | 230 // Simulate a click on the button so that the <a download ...> |
| 224 // attribute is used. | 231 // attribute is used. |
| 225 $('save-button-link').click(); | 232 $('save-button-link').click(); |
| 226 // Since we do the saving of the page. | 233 // Since we do the saving of the page. |
| 227 e.preventDefault(); | 234 e.preventDefault(); |
| 228 } | 235 } |
| 229 return; | 236 return; |
| 230 case 80: // p key. | 237 case 80: // p key. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 556 window.parent.postMessage(message, '*'); | 563 window.parent.postMessage(message, '*'); |
| 557 }, | 564 }, |
| 558 | 565 |
| 559 /** | 566 /** |
| 560 * @type {Viewport} the viewport of the PDF viewer. | 567 * @type {Viewport} the viewport of the PDF viewer. |
| 561 */ | 568 */ |
| 562 get viewport() { | 569 get viewport() { |
| 563 return this.viewport_; | 570 return this.viewport_; |
| 564 } | 571 } |
| 565 }; | 572 }; |
| OLD | NEW |