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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 cr.define('print_preview', function() {
6 'use strict';
7
8 /**
9 * Class describing the layout of the page.
10 *
11 * @constructor
12 */
13 function PageLayout(width, height, left, top, right, bottom) {
14 this.contentWidth_ = width;
15 this.contentHeight_ = height;
16 this.margins_ = new Margins(left, top, right, bottom);
17 this.margins_.roundToLocaleUnits();
18 };
19
20 PageLayout.prototype = {
21 /** @return {number} The width of the page. */
22 get pageWidth() {
23 return this.margins_.left + this.margins_.right + this.contentWidth_;
24 },
25
26 /** @return {number} The height of the page. */
27 get pageHeight() {
28 return this.margins_.top + this.margins_.bottom + this.contentHeight_;
29 }
30 };
31
32 // Export
33 return {
34 PageLayout: PageLayout
35 };
36 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698