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

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

Issue 6759044: Prepopulating "Print To PDF" select file dialog with a suggested filename and path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments. Created 9 years, 8 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
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/browser/printing/print_preview_message_handler.h" 5 #include "chrome/browser/printing/print_preview_message_handler.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/printing/print_job_manager.h" 8 #include "chrome/browser/printing/print_job_manager.h"
9 #include "chrome/browser/printing/print_preview_tab_controller.h" 9 #include "chrome/browser/printing/print_preview_tab_controller.h"
10 #include "chrome/browser/printing/print_view_manager.h" 10 #include "chrome/browser/printing/print_view_manager.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 TabContentsWrapper* wrapper = 74 TabContentsWrapper* wrapper =
75 TabContentsWrapper::GetCurrentWrapperForContents(print_preview_tab); 75 TabContentsWrapper::GetCurrentWrapperForContents(print_preview_tab);
76 wrapper->print_view_manager()->OverrideTitle(tab_contents()); 76 wrapper->print_view_manager()->OverrideTitle(tab_contents());
77 77
78 PrintPreviewUI* print_preview_ui = 78 PrintPreviewUI* print_preview_ui =
79 static_cast<PrintPreviewUI*>(print_preview_tab->web_ui()); 79 static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
80 PrintPreviewUIHTMLSource* html_source = print_preview_ui->html_source(); 80 PrintPreviewUIHTMLSource* html_source = print_preview_ui->html_source();
81 html_source->SetPrintPreviewData( 81 html_source->SetPrintPreviewData(
82 std::make_pair(shared_buf, params.data_size)); 82 std::make_pair(shared_buf, params.data_size));
83 print_preview_ui->PreviewDataIsAvailable(params.expected_pages_count, 83 print_preview_ui->PreviewDataIsAvailable(
84 tab_contents()->GetTitle()); 84 params.expected_pages_count,
85 wrapper->print_view_manager()->RenderSourceName());
85 } 86 }
86 87
87 void PrintPreviewMessageHandler::OnPrintPreviewNodeUnderContextMenu() { 88 void PrintPreviewMessageHandler::OnPrintPreviewNodeUnderContextMenu() {
88 PrintPreviewTabController::PrintPreview(tab_contents()); 89 PrintPreviewTabController::PrintPreview(tab_contents());
89 } 90 }
90 91
91 void PrintPreviewMessageHandler::OnScriptInitiatedPrintPreview() { 92 void PrintPreviewMessageHandler::OnScriptInitiatedPrintPreview() {
92 PrintPreviewTabController::PrintPreview(tab_contents()); 93 PrintPreviewTabController::PrintPreview(tab_contents());
93 } 94 }
94 95
(...skipping 13 matching lines...) Expand all
108 } 109 }
109 110
110 void PrintPreviewMessageHandler::DidStartLoading() { 111 void PrintPreviewMessageHandler::DidStartLoading() {
111 if (tab_contents()->delegate() && 112 if (tab_contents()->delegate() &&
112 printing::PrintPreviewTabController::IsPrintPreviewTab(tab_contents())) { 113 printing::PrintPreviewTabController::IsPrintPreviewTab(tab_contents())) {
113 tab_contents()->SetContentRestrictions(CONTENT_RESTRICTION_PRINT); 114 tab_contents()->SetContentRestrictions(CONTENT_RESTRICTION_PRINT);
114 } 115 }
115 } 116 }
116 117
117 } // namespace printing 118 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview_handler.h » ('j') | chrome/browser/ui/webui/print_preview_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698