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

Unified 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: Resolve conflicts 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/data/printable_area.js
diff --git a/chrome/browser/resources/print_preview/data/printable_area.js b/chrome/browser/resources/print_preview/data/printable_area.js
new file mode 100644
index 0000000000000000000000000000000000000000..4dd49556a1c4e2fb8d49271e3f129c885e0ab31e
--- /dev/null
+++ b/chrome/browser/resources/print_preview/data/printable_area.js
@@ -0,0 +1,64 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('print_preview', function() {
+ 'use strict';
+
+ /**
+ * Object describing the printable area of a page in the document.
+ * @param {!print_preview.Coordinate2d} origin Top left corner of the
+ * printable area of the document.
+ * @param {!print_preview.Size} size Size of the printable area of the
+ * document.
+ * @constructor
+ */
+ function PrintableArea(origin, size) {
+ /**
+ * Top left corner of the printable area of the document.
+ * @type {!print_preview.Coordinate2d}
+ * @private
+ */
+ this.origin_ = origin;
+
+ /**
+ * Size of the printable area of the document.
+ * @type {!print_preview.Size}
+ * @private
+ */
+ this.size_ = size;
+ };
+
+ PrintableArea.prototype = {
+ /**
+ * @return {!print_preview.Coordinate2d} Top left corner of the printable
+ * area of the document.
+ */
+ get origin() {
+ return this.origin_;
+ },
+
+ /**
+ * @return {!print_preview.Size} Size of the printable area of the document.
+ */
+ get size() {
+ return this.size_;
+ },
+
+ /**
+ * @param {print_preview.PrintableArea} other Other printable area to check
+ * for equality.
+ * @return {boolean} Whether another printable area is equal to this one.
+ */
+ equals: function(other) {
+ return other != null &&
+ this.origin_.equals(other.origin_) &&
+ this.size_.equals(other.size_);
+ }
+ };
+
+ // Export
+ return {
+ PrintableArea: PrintableArea
+ };
+});
« no previous file with comments | « chrome/browser/resources/print_preview/data/print_ticket_store.js ('k') | chrome/browser/resources/print_preview/data/size.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698