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

Side by Side Diff: chrome/renderer/print_web_view_helper.cc

Issue 3109005: Merge 53907 - Fix for Issue 50340: @page rules inside @media print rules are ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/renderer/print_web_view_helper.h" 5 #include "chrome/renderer/print_web_view_helper.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
10 #include "chrome/renderer/render_view.h" 10 #include "chrome/renderer/render_view.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 ConvertPixelsToPointDouble(margin_bottom_in_pixels); 431 ConvertPixelsToPointDouble(margin_bottom_in_pixels);
432 if (margin_left_in_points) 432 if (margin_left_in_points)
433 *margin_left_in_points = 433 *margin_left_in_points =
434 ConvertPixelsToPointDouble(margin_left_in_pixels); 434 ConvertPixelsToPointDouble(margin_left_in_pixels);
435 } 435 }
436 436
437 void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters( 437 void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters(
438 WebFrame* frame, ViewMsg_Print_Params* params) { 438 WebFrame* frame, ViewMsg_Print_Params* params) {
439 double content_width_in_points; 439 double content_width_in_points;
440 double content_height_in_points; 440 double content_height_in_points;
441 PrepareFrameAndViewForPrint prepare(*params, frame, frame->view());
441 PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params, 442 PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params,
442 &content_width_in_points, 443 &content_width_in_points,
443 &content_height_in_points, 444 &content_height_in_points,
444 NULL, NULL, NULL, NULL); 445 NULL, NULL, NULL, NULL);
445 #if defined(OS_MACOSX) 446 #if defined(OS_MACOSX)
446 params->printable_size = gfx::Size( 447 params->printable_size = gfx::Size(
447 static_cast<int>(content_width_in_points), 448 static_cast<int>(content_width_in_points),
448 static_cast<int>(content_height_in_points)); 449 static_cast<int>(content_height_in_points));
449 #else 450 #else
450 params->printable_size = gfx::Size( 451 params->printable_size = gfx::Size(
451 static_cast<int>(ConvertUnitDouble( 452 static_cast<int>(ConvertUnitDouble(
452 content_width_in_points, printing::kPointsPerInch, params->dpi)), 453 content_width_in_points, printing::kPointsPerInch, params->dpi)),
453 static_cast<int>(ConvertUnitDouble( 454 static_cast<int>(ConvertUnitDouble(
454 content_height_in_points, printing::kPointsPerInch, params->dpi))); 455 content_height_in_points, printing::kPointsPerInch, params->dpi)));
455 #endif 456 #endif
456 } 457 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698