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

Unified Diff: chrome/browser/resources/print_preview/data/ticket_items/landscape.js

Issue 580203002: Set orientation to 'AUTO' if we hide orientation option from user. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Thu Sep 18 12:07:42 PDT 2014 Created 6 years, 3 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 | « chrome/browser/resources/print_preview/data/print_ticket_store.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/data/ticket_items/landscape.js
diff --git a/chrome/browser/resources/print_preview/data/ticket_items/landscape.js b/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
index 907e54f2edeeb96eee841993c73921f1368f8ad6..cf70bd6dce64e96f6165906ffc6e5c2be43447bd 100644
--- a/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
+++ b/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
@@ -57,9 +57,8 @@ cr.define('print_preview.ticket_items', function() {
/** @override */
isCapabilityAvailable: function() {
var cap = this.getPageOrientationCapability_();
- if (!cap) {
+ if (!cap)
return false;
- }
var hasAutoOrPortraitOption = false;
var hasLandscapeOption = false;
cap.option.forEach(function(option) {
@@ -110,6 +109,19 @@ cr.define('print_preview.ticket_items', function() {
},
/**
+ * @return {boolean} Whether capability contains the |value|.
+ * @param {string} value Option to check.
+ */
+ hasOption: function(value) {
+ var cap = this.getPageOrientationCapability_();
+ if (!cap)
+ return false;
+ return cap.option.some(function(option) {
+ return option.type == value;
+ });
+ },
+
+ /**
* @return {Object} Page orientation capability of the selected destination.
* @private
*/
« no previous file with comments | « chrome/browser/resources/print_preview/data/print_ticket_store.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698