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

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

Issue 6216003: Make PrintWebViewHelper work with new WebKit API for printing a plugin. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // minimum (default) scaling. 61 // minimum (default) scaling.
62 // This is important for sites that try to fill the page. 62 // This is important for sites that try to fill the page.
63 gfx::Size print_layout_size(print_canvas_size_); 63 gfx::Size print_layout_size(print_canvas_size_);
64 print_layout_size.set_height(static_cast<int>( 64 print_layout_size.set_height(static_cast<int>(
65 static_cast<double>(print_layout_size.height()) * 1.25)); 65 static_cast<double>(print_layout_size.height()) * 1.25));
66 66
67 prev_view_size_ = web_view->size(); 67 prev_view_size_ = web_view->size();
68 68
69 web_view->resize(print_layout_size); 69 web_view->resize(print_layout_size);
70 70
71 #if defined(WEBFRAME_PRINTBEGIN_TAKES_NODE)
72 expected_pages_count_ = frame->printBegin(
73 print_canvas_size_, NULL, static_cast<int>(print_params.dpi),
74 &use_browser_overlays_);
75 #else
71 expected_pages_count_ = frame->printBegin( 76 expected_pages_count_ = frame->printBegin(
72 print_canvas_size_, static_cast<int>(print_params.dpi), 77 print_canvas_size_, static_cast<int>(print_params.dpi),
73 &use_browser_overlays_); 78 &use_browser_overlays_);
79 #endif
74 } 80 }
75 81
76 PrepareFrameAndViewForPrint::~PrepareFrameAndViewForPrint() { 82 PrepareFrameAndViewForPrint::~PrepareFrameAndViewForPrint() {
77 frame_->printEnd(); 83 frame_->printEnd();
78 web_view_->resize(prev_view_size_); 84 web_view_->resize(prev_view_size_);
79 } 85 }
80 86
81 87
82 PrintWebViewHelper::PrintWebViewHelper(RenderView* render_view) 88 PrintWebViewHelper::PrintWebViewHelper(RenderView* render_view)
83 : render_view_(render_view), 89 : render_view_(render_view),
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), 504 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(),
499 shared_mem_handle); 505 shared_mem_handle);
500 return true; 506 return true;
501 } 507 }
502 } 508 }
503 } 509 }
504 NOTREACHED(); 510 NOTREACHED();
505 return false; 511 return false;
506 } 512 }
507 #endif 513 #endif
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