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

Side by Side Diff: chrome/browser/printing/print_view_manager.cc

Issue 2518993002: Make printing work for PDF and Flash. (Closed)
Patch Set: Created 4 years, 1 month 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 | « chrome/browser/printing/print_view_manager.h ('k') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/printing/print_view_manager.h" 5 #include "chrome/browser/printing/print_view_manager.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 rfh->GetRoutingID(), has_selection); 116 rfh->GetRoutingID(), has_selection);
117 if (!PrintNowInternal(rfh, std::move(message))) 117 if (!PrintNowInternal(rfh, std::move(message)))
118 return false; 118 return false;
119 119
120 DCHECK(!print_preview_rfh_); 120 DCHECK(!print_preview_rfh_);
121 print_preview_rfh_ = rfh; 121 print_preview_rfh_ = rfh;
122 print_preview_state_ = USER_INITIATED_PREVIEW; 122 print_preview_state_ = USER_INITIATED_PREVIEW;
123 return true; 123 return true;
124 } 124 }
125 125
126 void PrintViewManager::PrintPreviewForWebNode() { 126 void PrintViewManager::PrintPreviewForWebNode(content::RenderFrameHost* rfh) {
127 if (print_preview_state_ != NOT_PREVIEWING) 127 if (print_preview_state_ != NOT_PREVIEWING)
128 return; 128 return;
129
130 DCHECK(rfh);
131 DCHECK(!print_preview_rfh_);
132 print_preview_rfh_ = rfh;
EhsanK 2016/11/21 16:39:15 I was not sure if we are accepting all types of fr
Lei Zhang 2016/11/21 20:07:55 AFAIK, there's only PDF and Flash. Both of which I
129 print_preview_state_ = USER_INITIATED_PREVIEW; 133 print_preview_state_ = USER_INITIATED_PREVIEW;
130 } 134 }
131 135
132 void PrintViewManager::PrintPreviewDone() { 136 void PrintViewManager::PrintPreviewDone() {
133 DCHECK_CURRENTLY_ON(BrowserThread::UI); 137 DCHECK_CURRENTLY_ON(BrowserThread::UI);
134 DCHECK_NE(NOT_PREVIEWING, print_preview_state_); 138 DCHECK_NE(NOT_PREVIEWING, print_preview_state_);
135 139
136 if (print_preview_state_ == SCRIPTED_PREVIEW) { 140 if (print_preview_state_ == SCRIPTED_PREVIEW) {
137 auto& map = g_scripted_print_preview_closure_map.Get(); 141 auto& map = g_scripted_print_preview_closure_map.Get();
138 auto it = map.find(scripted_print_preview_rph_); 142 auto it = map.find(scripted_print_preview_rph_);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, 248 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview,
245 OnShowScriptedPrintPreview) 249 OnShowScriptedPrintPreview)
246 IPC_MESSAGE_UNHANDLED(handled = false) 250 IPC_MESSAGE_UNHANDLED(handled = false)
247 IPC_END_MESSAGE_MAP() 251 IPC_END_MESSAGE_MAP()
248 252
249 return handled || 253 return handled ||
250 PrintViewManagerBase::OnMessageReceived(message, render_frame_host); 254 PrintViewManagerBase::OnMessageReceived(message, render_frame_host);
251 } 255 }
252 256
253 } // namespace printing 257 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698