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

Unified Diff: chrome/browser/resources/print_preview/data/size.js

Issue 10108001: Refactor print preview web ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve conflicts Created 8 years, 7 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
Index: chrome/browser/resources/print_preview/data/size.js
diff --git a/chrome/browser/resources/print_preview/data/size.js b/chrome/browser/resources/print_preview/data/size.js
new file mode 100644
index 0000000000000000000000000000000000000000..7b434188ce46d62f7acfe4466fafc7874b7da435
--- /dev/null
+++ b/chrome/browser/resources/print_preview/data/size.js
@@ -0,0 +1,56 @@
+// 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';
+
+ /**
+ * Immutable two-dimensional size.
+ * @param {number} width Width of the size.
+ * @param {number} height Height of the size.
+ * @constructor
+ */
+ function Size(width, height) {
+ /**
+ * Width of the size.
+ * @type {number}
+ * @private
+ */
+ this.width_ = width;
+
+ /**
+ * Height of the size.
+ * @type {number}
+ * @private
+ */
+ this.height_ = height;
+ };
+
+ Size.prototype = {
+ /** @return {number} Width of the size. */
+ get width() {
+ return this.width_;
+ },
+
+ /** @return {number} Height of the size. */
+ get height() {
+ return this.height_;
+ },
+
+ /**
+ * @param {print_preview.Size} other Other size object to compare against.
+ * @return {boolean} Whether this size object is equal to another.
+ */
+ equals: function(other) {
+ return other != null &&
+ this.width_ == other.width_ &&
+ this.height_ == other.height_;
+ }
+ };
+
+ // Export
+ return {
+ Size: Size
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698