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

Side by Side Diff: chrome/browser/resources/print_preview/previewarea/preview_area.js

Issue 575333002: Compile print_preview, part 2: reduce down to 260 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview
Patch Set: revert movement of enums: now handle in compiler pass 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Creates a PreviewArea object. It represents the area where the preview 9 * Creates a PreviewArea object. It represents the area where the preview
10 * document is displayed. 10 * document is displayed.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 * @return {boolean} Whether the preview area has a compatible plugin to 223 * @return {boolean} Whether the preview area has a compatible plugin to
224 * display the print preview in. 224 * display the print preview in.
225 */ 225 */
226 get hasCompatiblePlugin() { 226 get hasCompatiblePlugin() {
227 return this.previewGenerator_ != null; 227 return this.previewGenerator_ != null;
228 }, 228 },
229 229
230 /** 230 /**
231 * Processes a keyboard event that could possibly be used to change state of 231 * Processes a keyboard event that could possibly be used to change state of
232 * the preview plugin. 232 * the preview plugin.
233 * @param {MouseEvent} e Mouse event to process. 233 * @param {KeyboardEvent} e Keyboard event to process.
234 */ 234 */
235 handleDirectionalKeyEvent: function(e) { 235 handleDirectionalKeyEvent: function(e) {
236 // Make sure the PDF plugin is there. 236 // Make sure the PDF plugin is there.
237 // We only care about: PageUp, PageDown, Left, Up, Right, Down. 237 // We only care about: PageUp, PageDown, Left, Up, Right, Down.
238 // If the user is holding a modifier key, ignore. 238 // If the user is holding a modifier key, ignore.
239 if (!this.plugin_ || 239 if (!this.plugin_ ||
240 !arrayContains([33, 34, 37, 38, 39, 40], e.keyCode) || 240 !arrayContains([33, 34, 37, 38, 39, 40], e.keyCode) ||
241 e.metaKey || e.altKey || e.shiftKey || e.ctrlKey) { 241 e.metaKey || e.altKey || e.shiftKey || e.ctrlKey) {
242 return; 242 return;
243 } 243 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 new print_preview.Size(viewportWidth, viewportHeight)); 734 new print_preview.Size(viewportWidth, viewportHeight));
735 } 735 }
736 } 736 }
737 }; 737 };
738 738
739 // Export 739 // Export
740 return { 740 return {
741 PreviewArea: PreviewArea 741 PreviewArea: PreviewArea
742 }; 742 };
743 }); 743 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/native_layer.js ('k') | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698