Move Webstore URL concepts to //extensions and out
[chromium-blink-merge.git] / chrome / browser / resources / print_preview / data / printable_area.js
blob4dd49556a1c4e2fb8d49271e3f129c885e0ab31e
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 * 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
13 * document.
14 * @constructor
16 function PrintableArea(origin, size) {
17 /**
18 * Top left corner of the printable area of the document.
19 * @type {!print_preview.Coordinate2d}
20 * @private
22 this.origin_ = origin;
24 /**
25 * Size of the printable area of the document.
26 * @type {!print_preview.Size}
27 * @private
29 this.size_ = size;
32 PrintableArea.prototype = {
33 /**
34 * @return {!print_preview.Coordinate2d} Top left corner of the printable
35 * area of the document.
37 get origin() {
38 return this.origin_;
41 /**
42 * @return {!print_preview.Size} Size of the printable area of the document.
44 get size() {
45 return this.size_;
48 /**
49 * @param {print_preview.PrintableArea} other Other printable area to check
50 * for equality.
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_);
60 // Export
61 return {
62 PrintableArea: PrintableArea
64 });