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

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

Issue 1368013004: Define Print Preview default printer selection policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tags to DefaultPrinterSelection policy. Created 5 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.exportPath('print_preview'); 5 cr.exportPath('print_preview');
6 6
7 /** 7 /**
8 * @typedef {{selectSaveAsPdfDestination: boolean, 8 * @typedef {{selectSaveAsPdfDestination: boolean,
9 * layoutSettings.portrait: boolean, 9 * layoutSettings.portrait: boolean,
10 * pageRange: string, 10 * pageRange: string,
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 initialSettings['appKioskMode'] || false, 482 initialSettings['appKioskMode'] || false,
483 initialSettings['hidePrintWithSystemDialogLink'] || false, 483 initialSettings['hidePrintWithSystemDialogLink'] || false,
484 numberFormatSymbols[0] || ',', 484 numberFormatSymbols[0] || ',',
485 numberFormatSymbols[1] || '.', 485 numberFormatSymbols[1] || '.',
486 unitType, 486 unitType,
487 initialSettings['previewModifiable'] || false, 487 initialSettings['previewModifiable'] || false,
488 initialSettings['initiatorTitle'] || '', 488 initialSettings['initiatorTitle'] || '',
489 initialSettings['documentHasSelection'] || false, 489 initialSettings['documentHasSelection'] || false,
490 initialSettings['shouldPrintSelectionOnly'] || false, 490 initialSettings['shouldPrintSelectionOnly'] || false,
491 initialSettings['printerName'] || null, 491 initialSettings['printerName'] || null,
492 initialSettings['appState'] || null); 492 initialSettings['appState'] || null,
493 initialSettings['defaultDestinationSelectionRules'] || null);
493 494
494 var initialSettingsSetEvent = new Event( 495 var initialSettingsSetEvent = new Event(
495 NativeLayer.EventType.INITIAL_SETTINGS_SET); 496 NativeLayer.EventType.INITIAL_SETTINGS_SET);
496 initialSettingsSetEvent.initialSettings = nativeInitialSettings; 497 initialSettingsSetEvent.initialSettings = nativeInitialSettings;
497 this.dispatchEvent(initialSettingsSetEvent); 498 this.dispatchEvent(initialSettingsSetEvent);
498 }, 499 },
499 500
500 /** 501 /**
501 * Turn on the integration of Cloud Print. 502 * Turn on the integration of Cloud Print.
502 * @param {{cloudPrintURL: string, appKioskMode: string}} settings 503 * @param {{cloudPrintURL: string, appKioskMode: string}} settings
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 * @param {boolean} isDocumentModifiable Whether the document to print is 926 * @param {boolean} isDocumentModifiable Whether the document to print is
926 * modifiable. 927 * modifiable.
927 * @param {string} documentTitle Title of the document. 928 * @param {string} documentTitle Title of the document.
928 * @param {boolean} documentHasSelection Whether the document has selected 929 * @param {boolean} documentHasSelection Whether the document has selected
929 * content. 930 * content.
930 * @param {boolean} selectionOnly Whether only selected content should be 931 * @param {boolean} selectionOnly Whether only selected content should be
931 * printed. 932 * printed.
932 * @param {?string} systemDefaultDestinationId ID of the system default 933 * @param {?string} systemDefaultDestinationId ID of the system default
933 * destination. 934 * destination.
934 * @param {?string} serializedAppStateStr Serialized app state. 935 * @param {?string} serializedAppStateStr Serialized app state.
936 * @param {?string} serializedDefaultDestinationSelectionRulesStr Serialized
937 * default destination selection rules.
935 * @constructor 938 * @constructor
936 */ 939 */
937 function NativeInitialSettings( 940 function NativeInitialSettings(
938 isInKioskAutoPrintMode, 941 isInKioskAutoPrintMode,
939 isInAppKioskMode, 942 isInAppKioskMode,
940 hidePrintWithSystemDialogLink, 943 hidePrintWithSystemDialogLink,
941 thousandsDelimeter, 944 thousandsDelimeter,
942 decimalDelimeter, 945 decimalDelimeter,
943 unitType, 946 unitType,
944 isDocumentModifiable, 947 isDocumentModifiable,
945 documentTitle, 948 documentTitle,
946 documentHasSelection, 949 documentHasSelection,
947 selectionOnly, 950 selectionOnly,
948 systemDefaultDestinationId, 951 systemDefaultDestinationId,
949 serializedAppStateStr) { 952 serializedAppStateStr,
953 serializedDefaultDestinationSelectionRulesStr) {
950 954
951 /** 955 /**
952 * Whether the print preview should be in auto-print mode. 956 * Whether the print preview should be in auto-print mode.
953 * @type {boolean} 957 * @type {boolean}
954 * @private 958 * @private
955 */ 959 */
956 this.isInKioskAutoPrintMode_ = isInKioskAutoPrintMode; 960 this.isInKioskAutoPrintMode_ = isInKioskAutoPrintMode;
957 961
958 /** 962 /**
959 * Whether the print preview should switch to App Kiosk mode. 963 * Whether the print preview should switch to App Kiosk mode.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 * @private 1028 * @private
1025 */ 1029 */
1026 this.systemDefaultDestinationId_ = systemDefaultDestinationId; 1030 this.systemDefaultDestinationId_ = systemDefaultDestinationId;
1027 1031
1028 /** 1032 /**
1029 * Serialized app state. 1033 * Serialized app state.
1030 * @type {?string} 1034 * @type {?string}
1031 * @private 1035 * @private
1032 */ 1036 */
1033 this.serializedAppStateStr_ = serializedAppStateStr; 1037 this.serializedAppStateStr_ = serializedAppStateStr;
1038
1039 /**
1040 * Serialized default destination selection rules.
1041 * @type {?string}
1042 * @private
1043 */
1044 this.serializedDefaultDestinationSelectionRulesStr_ =
1045 serializedDefaultDestinationSelectionRulesStr;
1034 }; 1046 };
1035 1047
1036 NativeInitialSettings.prototype = { 1048 NativeInitialSettings.prototype = {
1037 /** 1049 /**
1038 * @return {boolean} Whether the print preview should be in auto-print mode. 1050 * @return {boolean} Whether the print preview should be in auto-print mode.
1039 */ 1051 */
1040 get isInKioskAutoPrintMode() { 1052 get isInKioskAutoPrintMode() {
1041 return this.isInKioskAutoPrintMode_; 1053 return this.isInKioskAutoPrintMode_;
1042 }, 1054 },
1043 1055
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 }, 1108 },
1097 1109
1098 /** @return {?string} ID of the system default destination. */ 1110 /** @return {?string} ID of the system default destination. */
1099 get systemDefaultDestinationId() { 1111 get systemDefaultDestinationId() {
1100 return this.systemDefaultDestinationId_; 1112 return this.systemDefaultDestinationId_;
1101 }, 1113 },
1102 1114
1103 /** @return {?string} Serialized app state. */ 1115 /** @return {?string} Serialized app state. */
1104 get serializedAppStateStr() { 1116 get serializedAppStateStr() {
1105 return this.serializedAppStateStr_; 1117 return this.serializedAppStateStr_;
1118 },
1119
1120 /** @return {?string} Serialized default destination selection rules. */
1121 get serializedDefaultDestinationSelectionRulesStr() {
1122 return this.serializedDefaultDestinationSelectionRulesStr_;
1106 } 1123 }
1107 }; 1124 };
1108 1125
1109 // Export 1126 // Export
1110 return { 1127 return {
1111 NativeInitialSettings: NativeInitialSettings, 1128 NativeInitialSettings: NativeInitialSettings,
1112 NativeLayer: NativeLayer 1129 NativeLayer: NativeLayer
1113 }; 1130 };
1114 }); 1131 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698