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

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

Issue 6479004: Print Preview: Hook up the print button to initiate a normal print operation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add a comment 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
« no previous file with comments | « chrome/browser/dom_ui/print_preview_handler.h ('k') | chrome/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/print_preview_handler.cc
===================================================================
--- chrome/browser/dom_ui/print_preview_handler.cc (revision 75293)
+++ chrome/browser/dom_ui/print_preview_handler.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/dom_ui/print_preview_handler.h"
#include "base/values.h"
+#include "chrome/browser/renderer_host/render_view_host.h"
#include "printing/backend/print_backend.h"
PrintPreviewHandler::PrintPreviewHandler()
@@ -17,6 +18,8 @@
void PrintPreviewHandler::RegisterMessages() {
web_ui_->RegisterMessageCallback("getPrinters",
NewCallback(this, &PrintPreviewHandler::HandleGetPrinters));
+ web_ui_->RegisterMessageCallback("print",
+ NewCallback(this, &PrintPreviewHandler::HandlePrint));
}
void PrintPreviewHandler::HandleGetPrinters(const ListValue*) {
@@ -31,3 +34,7 @@
web_ui_->CallJavascriptFunction(L"setPrinters", printers);
}
+
+void PrintPreviewHandler::HandlePrint(const ListValue*) {
+ web_ui_->GetRenderViewHost()->PrintForPrintPreview();
+}
« no previous file with comments | « chrome/browser/dom_ui/print_preview_handler.h ('k') | chrome/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698