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

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

Issue 10450022: Print Preview Print Destination Search Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Set --bary flag Created 8 years, 6 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 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 cr.dispatchSimpleEvent(this, PrintHeader.EventType.CANCEL_BUTTON_CLICK); 206 cr.dispatchSimpleEvent(this, PrintHeader.EventType.CANCEL_BUTTON_CLICK);
207 }, 207 },
208 208
209 /** 209 /**
210 * Called when a new destination is selected. Updates the text on the print 210 * Called when a new destination is selected. Updates the text on the print
211 * button. 211 * button.
212 * @private 212 * @private
213 */ 213 */
214 onDestinationSelect_: function() { 214 onDestinationSelect_: function() {
215 if (this.destinationStore_.selectedDestination.id == 215 if (this.destinationStore_.selectedDestination.id ==
216 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF) { 216 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF ||
217 this.destinationStore_.selectedDestination.id ==
218 print_preview.Destination.GooglePromotedId.DOCS) {
217 this.printButton_.textContent = localStrings.getString('saveButton'); 219 this.printButton_.textContent = localStrings.getString('saveButton');
218 } else { 220 } else {
219 this.printButton_.textContent = localStrings.getString('printButton'); 221 this.printButton_.textContent = localStrings.getString('printButton');
220 } 222 }
221 }, 223 },
222 224
223 /** 225 /**
224 * Called when the print ticket has changed. Disables the print button if 226 * Called when the print ticket has changed. Disables the print button if
225 * any of the settings are invalid. 227 * any of the settings are invalid.
226 * @private 228 * @private
227 */ 229 */
228 onTicketChange_: function() { 230 onTicketChange_: function() {
229 this.printButton_.disabled = 231 this.printButton_.disabled =
230 !this.printTicketStore_.isTicketValid() || 232 !this.printTicketStore_.isTicketValid() ||
231 !this.isEnabled_; 233 !this.isEnabled_;
232 this.updateSummary_(); 234 this.updateSummary_();
233 } 235 }
234 }; 236 };
235 237
236 // Export 238 // Export
237 return { 239 return {
238 PrintHeader: PrintHeader 240 PrintHeader: PrintHeader
239 }; 241 };
240 }); 242 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698