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

Side by Side Diff: chrome/browser/resources/print_preview/data/print_ticket_store.js

Issue 10829229: Fix duplex defaults. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 // TODO(rltoscano): Maybe clear print ticket when destination changes. Or 8 // TODO(rltoscano): Maybe clear print ticket when destination changes. Or
9 // better yet, carry over any print ticket state that is possible. I.e. if 9 // better yet, carry over any print ticket state that is possible. I.e. if
10 // destination changes, the new destination might not support duplex anymore, 10 // destination changes, the new destination might not support duplex anymore,
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 * Called when the capabilities of the selected destination are ready. 627 * Called when the capabilities of the selected destination are ready.
628 * @private 628 * @private
629 */ 629 */
630 onSelectedDestinationCapabilitiesReady_: function() { 630 onSelectedDestinationCapabilitiesReady_: function() {
631 var caps = this.destinationStore_.selectedDestination.capabilities; 631 var caps = this.destinationStore_.selectedDestination.capabilities;
632 var isFirstUpdate = this.capabilitiesHolder_.get() == null; 632 var isFirstUpdate = this.capabilitiesHolder_.get() == null;
633 this.capabilitiesHolder_.set(caps); 633 this.capabilitiesHolder_.set(caps);
634 if (isFirstUpdate) { 634 if (isFirstUpdate) {
635 cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE); 635 cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
636 } else { 636 } else {
637 // Reset user selection for certain ticket items.
638 this.duplex_.updateValue(null);
637 this.customMargins_.updateValue(null); 639 this.customMargins_.updateValue(null);
640
Albert Bodenhamer 2012/08/08 00:01:51 Did you mean to add the blank line?
Robert Toscano 2012/08/08 00:05:48 Yea to separate it from the next step, which is un
638 if (this.marginsType_.getValue() == 641 if (this.marginsType_.getValue() ==
639 print_preview.ticket_items.MarginsType.Value.CUSTOM) { 642 print_preview.ticket_items.MarginsType.Value.CUSTOM) {
640 this.marginsType_.updateValue( 643 this.marginsType_.updateValue(
641 print_preview.ticket_items.MarginsType.Value.DEFAULT); 644 print_preview.ticket_items.MarginsType.Value.DEFAULT);
642 } 645 }
643 cr.dispatchSimpleEvent( 646 cr.dispatchSimpleEvent(
644 this, PrintTicketStore.EventType.CAPABILITIES_CHANGE); 647 this, PrintTicketStore.EventType.CAPABILITIES_CHANGE);
645 } 648 }
646 } 649 }
647 }; 650 };
648 651
649 // Export 652 // Export
650 return { 653 return {
651 PrintTicketStore: PrintTicketStore 654 PrintTicketStore: PrintTicketStore
652 }; 655 };
653 }); 656 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/data/local_parsers.js ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698