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

Side by Side 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: Fixes broken tests 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 cr.define('print_preview', function() {
6 'use strict';
7
8 /**
9 * Immutable two-dimensional size.
10 * @param {number} width Width of the size.
11 * @param {number} height Height of the size.
12 * @constructor
13 */
14 function Size(width, height) {
15 /**
16 * Width of the size.
17 * @type {number}
18 * @private
19 */
20 this.width_ = width;
21
22 /**
23 * Height of the size.
24 * @type {number}
25 * @private
26 */
27 this.height_ = height;
28 };
29
30 Size.prototype = {
31 /** @return {number} Width of the size. */
32 get width() {
33 return this.width_;
34 },
35
36 /** @return {number} Height of the size. */
37 get height() {
38 return this.height_;
39 },
40
41 /**
42 * @param {print_preview.Size} other Other size object to compare against.
43 * @return {boolean} Whether this size object is equal to another.
44 */
45 equals: function(other) {
46 return other != null &&
47 this.width_ == other.width_ &&
48 this.height_ == other.height_;
49 }
50 };
51
52 // Export
53 return {
54 Size: Size
55 };
56 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698