Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / print_preview / data / ticket_items / landscape.js
index 907e54f..cf70bd6 100644 (file)
@@ -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
      */