Move Webstore URL concepts to //extensions and out
[chromium-blink-merge.git] / chrome / browser / resources / print_preview / data / size.js
blob7b434188ce46d62f7acfe4466fafc7874b7da435
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 cr.define('print_preview', function() {
6 'use strict';
8 /**
9 * Immutable two-dimensional size.
10 * @param {number} width Width of the size.
11 * @param {number} height Height of the size.
12 * @constructor
14 function Size(width, height) {
15 /**
16 * Width of the size.
17 * @type {number}
18 * @private
20 this.width_ = width;
22 /**
23 * Height of the size.
24 * @type {number}
25 * @private
27 this.height_ = height;
30 Size.prototype = {
31 /** @return {number} Width of the size. */
32 get width() {
33 return this.width_;
36 /** @return {number} Height of the size. */
37 get height() {
38 return this.height_;
41 /**
42 * @param {print_preview.Size} other Other size object to compare against.
43 * @return {boolean} Whether this size object is equal to another.
45 equals: function(other) {
46 return other != null &&
47 this.width_ == other.width_ &&
48 this.height_ == other.height_;
52 // Export
53 return {
54 Size: Size
56 });