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

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: Remove new widget 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 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..855961c8b7161377d89bb779e5b7d468e711ddff
--- /dev/null
+++ b/chrome/browser/resources/print_preview/data/printable_area.js
@@ -0,0 +1,66 @@
+// 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 equivalent to this
+ * one.
+ */
+ equals: function(other) {
+ return other != null &&
+ this.origin_.equals(other.origin_) &&
+ this.size_.equals(other.size_);
+ }
+ };
+
+ // Export
+ return {
+ PrintableArea: PrintableArea
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698