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

Side by Side Diff: chrome/browser/resources/print_preview/print_header.js

Issue 8343017: Print Preview: Hiding margins UI if an error occurs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 PrintHeader object. This object encapsulates all the elements 9 * Creates a PrintHeader object. This object encapsulates all the elements
10 * and logic related to the top part of the left pane in print_preview.html. 10 * and logic related to the top part of the left pane in print_preview.html.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 this.disableCancelButton(); 43 this.disableCancelButton();
44 closePrintPreviewTab(); 44 closePrintPreviewTab();
45 }.bind(this); 45 }.bind(this);
46 this.printButton_.onclick = this.onPrintButtonClicked_.bind(this); 46 this.printButton_.onclick = this.onPrintButtonClicked_.bind(this);
47 document.addEventListener('updateSummary', 47 document.addEventListener('updateSummary',
48 this.updateSummary_.bind(this)); 48 this.updateSummary_.bind(this));
49 document.addEventListener('updatePrintButton', 49 document.addEventListener('updatePrintButton',
50 this.updatePrintButton_.bind(this)); 50 this.updatePrintButton_.bind(this));
51 document.addEventListener('disableCancelButton', 51 document.addEventListener('disableCancelButton',
52 this.disableCancelButton.bind(this)); 52 this.disableCancelButton.bind(this));
53 document.addEventListener('PDFGenerationError',
54 this.onPDFGenerationError_.bind(this));
53 }, 55 },
54 56
55 /** 57 /**
58 * Executes when an |PDFGenerationError| event is occurs.
59 * @private
60 */
61 onPDFGenerationError_: function() {
62 this.printButton_.disabled = true;
63 },
64
65 /**
56 * Disables the cancel button and removes its keydown event listener. 66 * Disables the cancel button and removes its keydown event listener.
57 */ 67 */
58 disableCancelButton: function() { 68 disableCancelButton: function() {
59 window.onkeydown = null; 69 window.onkeydown = null;
60 this.cancelButton_.disabled = true; 70 this.cancelButton_.disabled = true;
61 }, 71 },
62 72
63 /** 73 /**
64 * Listener executing whenever |this.printButton_| is clicked. 74 * Listener executing whenever |this.printButton_| is clicked.
65 * @private 75 * @private
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // Removing extra spaces from within the string. 155 // Removing extra spaces from within the string.
146 html = html.replace(/\s{2,}/g, ' '); 156 html = html.replace(/\s{2,}/g, ' ');
147 this.summary_.innerHTML = html; 157 this.summary_.innerHTML = html;
148 }, 158 },
149 }; 159 };
150 160
151 return { 161 return {
152 PrintHeader: PrintHeader, 162 PrintHeader: PrintHeader,
153 }; 163 };
154 }); 164 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/preview_area.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