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

Unified Diff: chrome/browser/resources/print_preview/data/page_layout.js

Issue 10108001: Refactor print preview web ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/page_layout.js
diff --git a/chrome/browser/resources/print_preview/data/page_layout.js b/chrome/browser/resources/print_preview/data/page_layout.js
new file mode 100644
index 0000000000000000000000000000000000000000..496bb16be988019ba71ae4273a92aaefb3956a7a
--- /dev/null
+++ b/chrome/browser/resources/print_preview/data/page_layout.js
@@ -0,0 +1,36 @@
+// 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';
+
+ /**
+ * Class describing the layout of the page.
+ *
+ * @constructor
+ */
+ function PageLayout(width, height, left, top, right, bottom) {
+ this.contentWidth_ = width;
+ this.contentHeight_ = height;
+ this.margins_ = new Margins(left, top, right, bottom);
+ this.margins_.roundToLocaleUnits();
+ };
+
+ PageLayout.prototype = {
+ /** @return {number} The width of the page. */
+ get pageWidth() {
+ return this.margins_.left + this.margins_.right + this.contentWidth_;
+ },
+
+ /** @return {number} The height of the page. */
+ get pageHeight() {
+ return this.margins_.top + this.margins_.bottom + this.contentHeight_;
+ }
+ };
+
+ // Export
+ return {
+ PageLayout: PageLayout
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698