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

Side by Side Diff: chrome/browser/resources/print_preview/data/printable_area.js

Issue 10108001: Refactor print preview web ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 8 years, 8 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 * Object describing the printable area of a page in the document.
10 *
11 * @param {!print_preview.Coordinate2d} origin Top left corner of the
12 * printable area of the document.
13 * @param {!print_preview.Size} size Size of the printable area of the
14 * document.
15 * @constructor
16 */
17 function PrintableArea(origin, size) {
18 /**
19 * Top left corner of the printable area of the document.
20 * @type {!print_preview.Coordinate2d}
21 * @private
22 */
23 this.origin_ = origin;
24
25 /**
26 * Size of the printable area of the document.
27 * @type {!print_preview.Size}
28 * @private
29 */
30 this.size_ = size;
31 };
32
33 PrintableArea.prototype = {
34 /**
35 * @return {!print_preview.Coordinate2d} Top left corner of the printable
36 * area of the document.
37 */
38 get origin() {
39 return this.origin_;
40 },
41
42 /**
43 * @return {!print_preview.Size} Size of the printable area of the document.
44 */
45 get size() {
46 return this.size_;
47 },
48
49 /**
50 * @param {print_preview.PrintableArea} other Other printable area to check
51 * for equality.
52 * @return {boolean} Whether another printable area is equal to this one.
53 */
54 equals: function(other) {
55 return other != null &&
56 this.origin_.equals(other.origin_) &&
57 this.size_.equals(other.size_);
58 }
59 };
60
61 // Export
62 return {
63 PrintableArea: PrintableArea
64 };
65 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698