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

Unified Diff: chrome/browser/printing/print_view_manager.cc

Issue 12177009: Printing selection from context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/print_view_manager.cc
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 292a788bff617d3d716766b557dac00054e6003c..2921be3f3655ee56438cd0803cb506ed9d3748e0 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -130,15 +130,17 @@ bool PrintViewManager::PrintToDestination() {
return PrintNowInternal(new PrintMsg_PrintPages(routing_id()));
}
-bool PrintViewManager::PrintPreviewNow() {
+bool PrintViewManager::PrintPreviewNow(bool selection_only) {
// Users can send print commands all they want and it is beyond
// PrintViewManager's control. Just ignore the extra commands.
// See http://crbug.com/136842 for example.
if (print_preview_state_ != NOT_PREVIEWING)
return false;
- if (!PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id())))
+ if (!PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id(),
+ selection_only))) {
return false;
+ }
print_preview_state_ = USER_INITIATED_PREVIEW;
return true;
@@ -342,11 +344,10 @@ void PrintViewManager::OnScriptedPrintPreview(bool source_is_modifiable,
scripted_print_preview_rph_ = rph;
dialog_controller->PrintPreview(web_contents());
- PrintPreviewUI::SetSourceIsModifiable(
- dialog_controller->GetPrintPreviewForContents(web_contents()),
- source_is_modifiable);
- PrintPreviewUI::SetSourceHasSelection(
- dialog_controller->GetPrintPreviewForTab(web_contents()), false);
+ PrintHostMsg_RequestPrintPreview_Params params;
+ params.is_modifiable = source_is_modifiable;
+ PrintPreviewUI::SetInitialParams(
+ dialog_controller->GetPrintPreviewForContents(web_contents()), params);
}
void PrintViewManager::OnScriptedPrintPreviewReply(IPC::Message* reply_msg) {
« no previous file with comments | « chrome/browser/printing/print_view_manager.h ('k') | chrome/browser/resources/print_preview/native_layer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698