Chromium Code Reviews| Index: chrome/renderer/render_view.cc |
| =================================================================== |
| --- chrome/renderer/render_view.cc (revision 20864) |
| +++ chrome/renderer/render_view.cc (working copy) |
| @@ -451,8 +451,14 @@ |
| void RenderView::OnPrintPages() { |
| DCHECK(webview()); |
| - if (webview()) |
| - Print(webview()->GetMainFrame(), false); |
| + if (webview()) { |
| + // If the user has selected text in the currently focused frame we print |
| + // only that frame (this makes print selection work for multiple frames). |
| + if (webview()->GetFocusedFrame()->HasSelection()) |
| + Print(webview()->GetFocusedFrame(), false); |
| + else |
| + Print(webview()->GetMainFrame(), false); |
| + } |
| } |
| void RenderView::OnPrintingDone(int document_cookie, bool success) { |
| @@ -2309,7 +2315,11 @@ |
| } |
| void RenderView::ScriptedPrint(WebFrame* frame) { |
| - Print(frame, true); |
| + DCHECK(webview()); |
| + if (webview()) { |
| + // Print the full page - not just the frame the javascript is running from. |
| + Print(webview()->GetMainFrame(), true); |
|
darin (slow to review)
2009/09/16 16:28:50
this seems like it is introducing a potential web
M-A Ruel
2009/09/16 16:35:03
That is interesting, I didn't realize that change.
|
| + } |
| } |
| void RenderView::UserMetricsRecordAction(const std::wstring& action) { |