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

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

Issue 8761014: Print Preview: Set source modifiable bit for scripted printing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove logging statement Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/print_view_manager.h ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_view_manager.cc
===================================================================
--- chrome/browser/printing/print_view_manager.cc (revision 112365)
+++ chrome/browser/printing/print_view_manager.cc (working copy)
@@ -4,6 +4,8 @@
#include "chrome/browser/printing/print_view_manager.h"
+#include <map>
+
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
@@ -258,7 +260,8 @@
content::NotificationService::NoDetails());
}
-void PrintViewManager::OnScriptedPrintPreview(IPC::Message* reply_msg) {
+void PrintViewManager::OnScriptedPrintPreview(bool source_is_modifiable,
+ IPC::Message* reply_msg) {
BrowserThread::CurrentlyOn(BrowserThread::UI);
ScriptedPrintPreviewClosureMap& map =
g_scripted_print_preview_closure_map.Get();
@@ -279,6 +282,13 @@
return;
}
+ PrintPreviewTabController* tab_controller =
+ PrintPreviewTabController::GetInstance();
+ if (!tab_controller) {
+ Send(reply_msg);
+ return;
+ }
+
print_preview_state_ = SCRIPTED_PREVIEW;
base::Closure callback =
base::Bind(&PrintViewManager::OnScriptedPrintPreviewReply,
@@ -287,7 +297,10 @@
map[rph] = callback;
scripted_print_preview_rph_ = rph;
- PrintPreviewTabController::PrintPreview(tab_);
+ tab_controller->PrintPreview(tab_);
+ PrintPreviewUI::SetSourceIsModifiable(
+ tab_controller->GetPrintPreviewForTab(tab_),
+ source_is_modifiable);
}
void PrintViewManager::OnScriptedPrintPreviewReply(IPC::Message* reply_msg) {
« no previous file with comments | « chrome/browser/printing/print_view_manager.h ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698