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

Unified Diff: chrome/browser/resources/print_preview/cloud_print_interface.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
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/data/destination_store.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/cloud_print_interface.js
diff --git a/chrome/browser/resources/print_preview/cloud_print_interface.js b/chrome/browser/resources/print_preview/cloud_print_interface.js
index a31ecdee90ac5e0e467f3986a8e5c85705a51199..e62257b767b897fe663d0de2e519ed849ebc95ff 100644
--- a/chrome/browser/resources/print_preview/cloud_print_interface.js
+++ b/chrome/browser/resources/print_preview/cloud_print_interface.js
@@ -13,10 +13,13 @@ cr.define('cloudprint', function() {
* @param {!print_preview.NativeLayer} nativeLayer Native layer used to get
* Auth2 tokens.
* @param {!print_preview.UserInfo} userInfo User information repository.
+ * @param {boolean} isInAppKioskMode Whether the print preview is in App
+ * Kiosk mode.
* @constructor
* @extends {cr.EventTarget}
*/
- function CloudPrintInterface(baseUrl, nativeLayer, userInfo) {
+ function CloudPrintInterface(
+ baseUrl, nativeLayer, userInfo, isInAppKioskMode) {
/**
* The base URL of the Google Cloud Print API.
* @type {string}
@@ -39,6 +42,14 @@ cr.define('cloudprint', function() {
this.userInfo_ = userInfo;
/**
+ * Whether Print Preview is in App Kiosk mode, basically, use only printers
+ * available for the device.
+ * @type {boolean}
+ * @private
+ */
+ this.isInAppKioskMode_ = isInAppKioskMode;
+
+ /**
* Currently logged in users (identified by email) mapped to the Google
* session index.
* @type {!Object.<string, number>}
@@ -179,6 +190,11 @@ cr.define('cloudprint', function() {
var account = opt_account || '';
var origins =
opt_origin && [opt_origin] || CloudPrintInterface.CLOUD_ORIGINS_;
+ if (this.isInAppKioskMode_) {
+ origins = origins.filter(function(origin) {
+ return origin != print_preview.Destination.Origin.COOKIES;
+ });
+ }
this.abortSearchRequests_(origins);
this.search_(true, account, origins);
this.search_(false, account, origins);
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/data/destination_store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698