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

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: 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..001df4ede1b603ba6b47077b02174aae8b169271 100644
--- a/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
+++ b/chrome/browser/resources/print_preview/data/ticket_items/landscape.js
@@ -91,7 +91,9 @@ cr.define('print_preview.ticket_items', function() {
/** @override */
getCapabilityNotAvailableValueInternal: function() {
var doc = this.getDocumentInfoInternal();
- return doc.hasCssMediaStyles ?
+ // TODO(vitalybuka): For landscape PDF dimmensions should be
Aleksey Shlyapnikov 2014/09/18 19:03:01 dimensions
Vitaly Buka (NO REVIEWS) 2014/09/18 19:08:46 Done.
+ // width > height. Find why it's not true.
+ return (!doc.isModifiable || doc.hasCssMediaStyles) ?
Aleksey Shlyapnikov 2014/09/18 19:03:01 Let's not add this check.
Vitaly Buka (NO REVIEWS) 2014/09/18 19:08:46 Done.
(doc.pageSize.width > doc.pageSize.height) :
false;
},
@@ -110,6 +112,22 @@ 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;
+ }
Aleksey Shlyapnikov 2014/09/18 19:03:01 Remove brackets.
Vitaly Buka (NO REVIEWS) 2014/09/18 19:08:46 Done.
+ var result = false;
+ cap.option.forEach(function(option) {
Aleksey Shlyapnikov 2014/09/18 19:03:01 return capability.option.some(...
Vitaly Buka (NO REVIEWS) 2014/09/18 19:08:46 Done.
+ result = result || option.type == value;
+ });
+ return result;
+ },
+
+ /**
* @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