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() {
9 * Object describing the printable area of a page in the document.
10 * @param {!print_preview.Coordinate2d} origin Top left corner of the
11 * printable area of the document.
12 * @param {!print_preview.Size} size Size of the printable area of the
16 function PrintableArea(origin
, size
) {
18 * Top left corner of the printable area of the document.
19 * @type {!print_preview.Coordinate2d}
22 this.origin_
= origin
;
25 * Size of the printable area of the document.
26 * @type {!print_preview.Size}
32 PrintableArea
.prototype = {
34 * @return {!print_preview.Coordinate2d} Top left corner of the printable
35 * area of the document.
42 * @return {!print_preview.Size} Size of the printable area of the document.
49 * @param {print_preview.PrintableArea} other Other printable area to check
51 * @return {boolean} Whether another printable area is equal to this one.
53 equals: function(other
) {
54 return other
!= null &&
55 this.origin_
.equals(other
.origin_
) &&
56 this.size_
.equals(other
.size_
);
62 PrintableArea
: PrintableArea