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

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

Issue 2868071: Fix for Issue 50340: @page rules inside @media print rules are not properly... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/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
« 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 ConvertPixelsToPointDouble(margin_bottom_in_pixels); 432 ConvertPixelsToPointDouble(margin_bottom_in_pixels);
433 if (margin_left_in_points) 433 if (margin_left_in_points)
434 *margin_left_in_points = 434 *margin_left_in_points =
435 ConvertPixelsToPointDouble(margin_left_in_pixels); 435 ConvertPixelsToPointDouble(margin_left_in_pixels);
436 } 436 }
437 437
438 void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters( 438 void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters(
439 WebFrame* frame, ViewMsg_Print_Params* params) { 439 WebFrame* frame, ViewMsg_Print_Params* params) {
440 double content_width_in_points; 440 double content_width_in_points;
441 double content_height_in_points; 441 double content_height_in_points;
442 PrepareFrameAndViewForPrint prepare(*params, frame, frame->view());
442 PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params, 443 PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params,
443 &content_width_in_points, 444 &content_width_in_points,
444 &content_height_in_points, 445 &content_height_in_points,
445 NULL, NULL, NULL, NULL); 446 NULL, NULL, NULL, NULL);
446 #if defined(OS_MACOSX) 447 #if defined(OS_MACOSX)
447 params->printable_size = gfx::Size( 448 params->printable_size = gfx::Size(
448 static_cast<int>(content_width_in_points), 449 static_cast<int>(content_width_in_points),
449 static_cast<int>(content_height_in_points)); 450 static_cast<int>(content_height_in_points));
450 #else 451 #else
451 params->printable_size = gfx::Size( 452 params->printable_size = gfx::Size(
452 static_cast<int>(ConvertUnitDouble( 453 static_cast<int>(ConvertUnitDouble(
453 content_width_in_points, printing::kPointsPerInch, params->dpi)), 454 content_width_in_points, printing::kPointsPerInch, params->dpi)),
454 static_cast<int>(ConvertUnitDouble( 455 static_cast<int>(ConvertUnitDouble(
455 content_height_in_points, printing::kPointsPerInch, params->dpi))); 456 content_height_in_points, printing::kPointsPerInch, params->dpi)));
456 #endif 457 #endif
457 } 458 }
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