Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(954)

Side by Side Diff: chrome/browser/resources/pdf/pdf.js

Issue 615853003: Handle the keyboard event for ctrl+a inside pdf.js instead of out_of_process_pdf.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pdf/out_of_process_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 || e.metaKey) {
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
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 };
OLDNEW
« no previous file with comments | « no previous file | pdf/out_of_process_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698