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

Unified Diff: chrome/browser/resources/print_preview/print_preview.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/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index ac3a0ab789135db2746d6fe3b522398b759867d9..1bcc67b10c1b38bc902668deb46ad76dd7d86ced 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -194,6 +194,14 @@ cr.define('print_preview', function() {
this.isInKioskAutoPrintMode_ = false;
/**
+ * Whether Print Preview is in App Kiosk mode, basically, use only printers
+ * available for the device.
+ * @type {boolean}
+ * @private
+ */
+ this.isInAppKioskMode_ = false;
+
+ /**
* State of the print preview UI.
* @type {print_preview.PrintPreview.UiState_}
* @private
@@ -530,6 +538,7 @@ cr.define('print_preview', function() {
var settings = event.initialSettings;
this.isInKioskAutoPrintMode_ = settings.isInKioskAutoPrintMode;
+ this.isInAppKioskMode_ = settings.isInAppKioskMode;
// The following components must be initialized in this order.
this.appState_.init(
@@ -544,12 +553,13 @@ cr.define('print_preview', function() {
settings.decimalDelimeter,
settings.unitType,
settings.selectionOnly);
- this.destinationStore_.init();
+ this.destinationStore_.init(settings.isInAppKioskMode);
this.appState_.setInitialized();
$('document-title').innerText = settings.documentTitle;
setIsVisible($('system-dialog-link'),
!settings.hidePrintWithSystemDialogLink);
+ setIsVisible($('cloud-print-dialog-link'), !settings.isInAppKioskMode);
},
/**
@@ -563,7 +573,8 @@ cr.define('print_preview', function() {
this.cloudPrintInterface_ = new cloudprint.CloudPrintInterface(
event.baseCloudPrintUrl,
this.nativeLayer_,
- this.userInfo_);
+ this.userInfo_,
+ event.appKioskMode);
this.tracker.add(
this.cloudPrintInterface_,
cloudprint.CloudPrintInterface.EventType.SUBMIT_DONE,
@@ -662,7 +673,9 @@ cr.define('print_preview', function() {
*/
onCloudPrintError_: function(event) {
if (event.status == 403) {
- this.destinationSearch_.showCloudPrintPromo();
+ if (!this.isInAppKioskMode_) {
+ this.destinationSearch_.showCloudPrintPromo();
+ }
} else if (event.status == 0) {
return; // Ignore, the system does not have internet connectivity.
} else {

Powered by Google App Engine
This is Rietveld 408576698