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

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: Adding documentation 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('errorOccurred',
54 this.onErrorOccurred.bind(this));
53 }, 55 },
54 56
55 /** 57 /**
58 * Executes when an |errorOccured| event is occurs.
59 */
60 onErrorOccurred: function() {
61 this.printButton_.disabled = true;
62 },
63
64 /**
56 * Disables the cancel button and removes its keydown event listener. 65 * Disables the cancel button and removes its keydown event listener.
57 */ 66 */
58 disableCancelButton: function() { 67 disableCancelButton: function() {
59 window.onkeydown = null; 68 window.onkeydown = null;
60 this.cancelButton_.disabled = true; 69 this.cancelButton_.disabled = true;
61 }, 70 },
62 71
63 /** 72 /**
64 * Listener executing whenever |this.printButton_| is clicked. 73 * Listener executing whenever |this.printButton_| is clicked.
65 * @private 74 * @private
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // Removing extra spaces from within the string. 154 // Removing extra spaces from within the string.
146 html = html.replace(/\s{2,}/g, ' '); 155 html = html.replace(/\s{2,}/g, ' ');
147 this.summary_.innerHTML = html; 156 this.summary_.innerHTML = html;
148 }, 157 },
149 }; 158 };
150 159
151 return { 160 return {
152 PrintHeader: PrintHeader, 161 PrintHeader: PrintHeader,
153 }; 162 };
154 }); 163 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698