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

Unified Diff: chrome/browser/webui/print_preview_handler.cc

Issue 6533006: Print Preview: Hook up the print button to initiate printing without displaying a print dialog. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed review comments. Created 9 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/webui/print_preview_handler.cc
diff --git a/chrome/browser/webui/print_preview_handler.cc b/chrome/browser/webui/print_preview_handler.cc
index 320ee99730ac3ed155910a621b2d84be3528f4c7..0e1b1b463248d7bc911677a71eae6779bc7152e2 100644
--- a/chrome/browser/webui/print_preview_handler.cc
+++ b/chrome/browser/webui/print_preview_handler.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/webui/print_preview_handler.h"
#include "base/values.h"
+#include "chrome/browser/webui/web_ui_util.h"
arv (Not doing code reviews) 2011/02/24 23:21:03 This is no longer needed
kmadhusu 2011/03/01 01:55:50 Done.
#include "chrome/browser/renderer_host/render_view_host.h"
#include "printing/backend/print_backend.h"
@@ -35,6 +36,12 @@ void PrintPreviewHandler::HandleGetPrinters(const ListValue*) {
web_ui_->CallJavascriptFunction(L"setPrinters", printers);
}
-void PrintPreviewHandler::HandlePrint(const ListValue*) {
- web_ui_->GetRenderViewHost()->PrintForPrintPreview();
+void PrintPreviewHandler::HandlePrint(const ListValue* args) {
+ std::string json_str;
+ CHECK(args->GetString(0, &json_str));
+ if (json_str.empty()) {
+ NOTREACHED() << "Empty print job settings";
+ return;
+ }
+ web_ui_->GetRenderViewHost()->PrintForPrintPreview(json_str);
}

Powered by Google App Engine
This is Rietveld 408576698