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

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

Issue 8200010: Sanity check the printable area returned by windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | printing/page_setup.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 margin_left_in_pixels - 978 margin_left_in_pixels -
979 margin_right_in_pixels); 979 margin_right_in_pixels);
980 page_layout_in_points->content_height = 980 page_layout_in_points->content_height =
981 ConvertPixelsToPoint(page_size_in_pixels.height - 981 ConvertPixelsToPoint(page_size_in_pixels.height -
982 margin_top_in_pixels - 982 margin_top_in_pixels -
983 margin_bottom_in_pixels); 983 margin_bottom_in_pixels);
984 984
985 // Invalid page size and/or margins. We just use the default setting. 985 // Invalid page size and/or margins. We just use the default setting.
986 if (page_layout_in_points->content_width < 1.0 || 986 if (page_layout_in_points->content_width < 1.0 ||
987 page_layout_in_points->content_height < 1.0) { 987 page_layout_in_points->content_height < 1.0) {
988 // TODO(vandebo) remove CHECK after debugging crbug.com/96063
989 CHECK(frame != NULL); 988 CHECK(frame != NULL);
vandebo (ex-Chrome) 2011/10/07 19:50:00 I'm leaving this check in because it won't run ver
990 GetPageSizeAndMarginsInPoints(NULL, page_index, default_params, 989 GetPageSizeAndMarginsInPoints(NULL, page_index, default_params,
991 page_layout_in_points); 990 page_layout_in_points);
992 return; 991 return;
993 } 992 }
994 993
995 page_layout_in_points->margin_top = 994 page_layout_in_points->margin_top =
996 ConvertPixelsToPointDouble(margin_top_in_pixels); 995 ConvertPixelsToPointDouble(margin_top_in_pixels);
997 page_layout_in_points->margin_right = 996 page_layout_in_points->margin_right =
998 ConvertPixelsToPointDouble(margin_right_in_pixels); 997 ConvertPixelsToPointDouble(margin_right_in_pixels);
999 page_layout_in_points->margin_bottom = 998 page_layout_in_points->margin_bottom =
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 PrintWebViewHelper::PrintPreviewContext::GetPrintCanvasSize() const { 1567 PrintWebViewHelper::PrintPreviewContext::GetPrintCanvasSize() const {
1569 return prep_frame_view_->GetPrintCanvasSize(); 1568 return prep_frame_view_->GetPrintCanvasSize();
1570 } 1569 }
1571 1570
1572 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { 1571 void PrintWebViewHelper::PrintPreviewContext::ClearContext() {
1573 prep_frame_view_.reset(); 1572 prep_frame_view_.reset();
1574 metafile_.reset(); 1573 metafile_.reset();
1575 pages_to_render_.clear(); 1574 pages_to_render_.clear();
1576 error_ = PREVIEW_ERROR_NONE; 1575 error_ = PREVIEW_ERROR_NONE;
1577 } 1576 }
OLDNEW
« no previous file with comments | « no previous file | printing/page_setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698