Index: chrome/browser/dom_ui/print_preview_handler.cc |
diff --git a/chrome/browser/dom_ui/print_preview_handler.cc b/chrome/browser/dom_ui/print_preview_handler.cc |
index 45d4eacc312c8e52ccf5ce17a8e769eb2f645b80..519bf815503ac4d4efcf84f053a5ca4b91326c9f 100644 |
--- a/chrome/browser/dom_ui/print_preview_handler.cc |
+++ b/chrome/browser/dom_ui/print_preview_handler.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/dom_ui/print_preview_handler.h" |
#include "base/values.h" |
+#include "chrome/browser/webui/web_ui_util.h" |
#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( |
+ web_ui_util::GetJsonResponseFromFirstArgumentInList(args)); |
arv (Not doing code reviews)
2011/02/21 02:00:05
This looks wrong. Why does GetJSONResponseFromFirs
kmadhusu
2011/02/22 02:56:34
From my understanding, GetJSONResponseFromFirstArg
arv (Not doing code reviews)
2011/02/23 19:38:52
A separate CL is fine.
|
+ if (json_str.empty()) { |
+ NOTREACHED() << "Empty print job settings"; |
+ return; |
+ } |
+ web_ui_->GetRenderViewHost()->PrintForPrintPreview(json_str); |
} |