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

Side by Side Diff: chrome/browser/resources/print_preview/preview_generator.js

Issue 2862203002: Print Preview: Fix data/ errors (Closed)
Patch Set: Fix destination resolver Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Interface to the Chromium print preview generator. 9 * Interface to the Chromium print preview generator.
10 * @param {!print_preview.DestinationStore} destinationStore Used to get the 10 * @param {!print_preview.DestinationStore} destinationStore Used to get the
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 var size = new print_preview.Size( 320 var size = new print_preview.Size(
321 event.pageLayout.printableAreaWidth, 321 event.pageLayout.printableAreaWidth,
322 event.pageLayout.printableAreaHeight); 322 event.pageLayout.printableAreaHeight);
323 323
324 var margins = new print_preview.Margins( 324 var margins = new print_preview.Margins(
325 Math.round(event.pageLayout.marginTop), 325 Math.round(event.pageLayout.marginTop),
326 Math.round(event.pageLayout.marginRight), 326 Math.round(event.pageLayout.marginRight),
327 Math.round(event.pageLayout.marginBottom), 327 Math.round(event.pageLayout.marginBottom),
328 Math.round(event.pageLayout.marginLeft)); 328 Math.round(event.pageLayout.marginLeft));
329 329
330 var o = print_preview.ticket_items.CustomMargins.Orientation; 330 var o = print_preview.ticket_items.CustomMarginsOrientation;
331 var pageSize = new print_preview.Size( 331 var pageSize = new print_preview.Size(
332 event.pageLayout.contentWidth + 332 event.pageLayout.contentWidth +
333 margins.get(o.LEFT) + margins.get(o.RIGHT), 333 margins.get(o.LEFT) + margins.get(o.RIGHT),
334 event.pageLayout.contentHeight + 334 event.pageLayout.contentHeight +
335 margins.get(o.TOP) + margins.get(o.BOTTOM)); 335 margins.get(o.TOP) + margins.get(o.BOTTOM));
336 336
337 this.documentInfo_.updatePageInfo( 337 this.documentInfo_.updatePageInfo(
338 new print_preview.PrintableArea(origin, size), 338 new print_preview.PrintableArea(origin, size),
339 pageSize, 339 pageSize,
340 event.hasCustomPageSizeStyle, 340 event.hasCustomPageSizeStyle,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // current one. 404 // current one.
405 cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.FAIL); 405 cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.FAIL);
406 } 406 }
407 }; 407 };
408 408
409 // Export 409 // Export
410 return { 410 return {
411 PreviewGenerator: PreviewGenerator 411 PreviewGenerator: PreviewGenerator
412 }; 412 };
413 }); 413 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698