Index: chrome/browser/resources/print_preview/data/capabilities_holder.js |
diff --git a/chrome/browser/resources/print_preview/data/capabilities_holder.js b/chrome/browser/resources/print_preview/data/capabilities_holder.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..55f129d5ffef04da1b847ae6fb40394db6042cf3 |
--- /dev/null |
+++ b/chrome/browser/resources/print_preview/data/capabilities_holder.js |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+cr.define('print_preview', function() { |
+ 'use strict'; |
+ |
+ /** |
+ * Mutable reference to a capabilities object. |
+ * @param {!print_preview.ChromiumCapabilities} Initial instance of the |
+ * reference. |
+ * @constructor |
+ */ |
+ function CapabilitiesHolder(capabilities) { |
+ /** |
+ * Reference to the capabilities object. |
+ * @type {!print_preview.ChromiumCapabilities} |
+ * @private |
+ */ |
+ this.capabilities_ = capabilities; |
+ }; |
+ |
+ CapabilitiesHolder.prototype = { |
+ /** |
+ * @return {!print_preview.ChromiumCapabilities} The instance held by the |
+ * holder. |
+ */ |
+ get: function() { |
+ return this.capabilities_; |
+ }, |
+ |
+ /** |
+ * @param {!print_preview.ChromiumCapabilities} New instance to put into the |
+ * holder. |
+ */ |
+ set: function(capabilities) { |
+ this.capabilities_ = capabilities; |
+ } |
+ }; |
+ |
+ // Export |
+ return { |
+ CapabilitiesHolder: CapabilitiesHolder |
+ }; |
+}); |