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

Unified Diff: chrome/browser/resources/print_preview/native_layer.js

Issue 387073002: Print preview changes for App Kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrintPreviewWebUITest.* Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/native_layer.js
diff --git a/chrome/browser/resources/print_preview/native_layer.js b/chrome/browser/resources/print_preview/native_layer.js
index 2fd26d232475b875d488792c9841f258e5748690..85a37ba90b3493ed5d7d8a18c1f1c6288595df60 100644
--- a/chrome/browser/resources/print_preview/native_layer.js
+++ b/chrome/browser/resources/print_preview/native_layer.js
@@ -403,6 +403,7 @@ cr.define('print_preview', function() {
var nativeInitialSettings = new print_preview.NativeInitialSettings(
initialSettings['printAutomaticallyInKioskMode'] || false,
+ initialSettings['appKioskMode'] || false,
initialSettings['hidePrintWithSystemDialogLink'] || false,
numberFormatSymbols[0] || ',',
numberFormatSymbols[1] || '.',
@@ -425,10 +426,11 @@ cr.define('print_preview', function() {
* @param {string} cloudPrintURL The URL to use for cloud print servers.
* @private
*/
- onSetUseCloudPrint_: function(cloudPrintURL) {
+ onSetUseCloudPrint_: function(settings) {
var cloudPrintEnableEvent = new Event(
NativeLayer.EventType.CLOUD_PRINT_ENABLE);
- cloudPrintEnableEvent.baseCloudPrintUrl = cloudPrintURL;
+ cloudPrintEnableEvent.baseCloudPrintUrl = settings['cloudPrintUrl'] || '';
+ cloudPrintEnableEvent.appKioskMode = settings['appKioskMode'] || false;
this.dispatchEvent(cloudPrintEnableEvent);
},
@@ -695,6 +697,8 @@ cr.define('print_preview', function() {
* Initial settings retrieved from the native layer.
* @param {boolean} isInKioskAutoPrintMode Whether the print preview should be
* in auto-print mode.
+ * @param {boolean} isInAppKioskMode Whether the print preview is in App Kiosk
+ * mode.
* @param {string} thousandsDelimeter Character delimeter of thousands digits.
* @param {string} decimalDelimeter Character delimeter of the decimal point.
* @param {!print_preview.MeasurementSystem.UnitType} unitType Unit type of
@@ -713,6 +717,7 @@ cr.define('print_preview', function() {
*/
function NativeInitialSettings(
isInKioskAutoPrintMode,
+ isInAppKioskMode,
hidePrintWithSystemDialogLink,
thousandsDelimeter,
decimalDelimeter,
@@ -732,6 +737,13 @@ cr.define('print_preview', function() {
this.isInKioskAutoPrintMode_ = isInKioskAutoPrintMode;
/**
+ * Whether the print preview should switch to App Kiosk mode.
+ * @type {boolean}
+ * @private
+ */
+ this.isInAppKioskMode_ = isInAppKioskMode;
+
+ /**
* Whether we should hide the link which shows the system print dialog.
* @type {boolean}
* @private
@@ -811,6 +823,14 @@ cr.define('print_preview', function() {
},
/**
+ * @return {boolean} Whether the print preview should switch to App Kiosk
+ * mode.
+ */
+ get isInAppKioskMode() {
+ return this.isInAppKioskMode_;
+ },
+
+ /**
* @return {boolean} Whether we should hide the link which shows the
system print dialog.
*/

Powered by Google App Engine
This is Rietveld 408576698