| 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..f24a9ddfe83065e4597c71293abf8946034ef0a9 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/dom_ui/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));
|
| + if (json_str.empty()) {
|
| + NOTREACHED() << "Empty print job settings";
|
| + return;
|
| + }
|
| + web_ui_->GetRenderViewHost()->PrintForPrintPreview(json_str);
|
| }
|
|
|