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

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

Issue 8055036: Revert 103010 - Refactored code to move cloudprint specific code into print_preview_cloud.js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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/ui/webui/print_preview_handler.h ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_handler.cc
===================================================================
--- chrome/browser/ui/webui/print_preview_handler.cc (revision 103066)
+++ chrome/browser/ui/webui/print_preview_handler.cc (working copy)
@@ -565,6 +565,8 @@
NewCallback(this, &PrintPreviewHandler::HandleShowSystemDialog));
web_ui_->RegisterMessageCallback("signIn",
NewCallback(this, &PrintPreviewHandler::HandleSignin));
+ web_ui_->RegisterMessageCallback("printWithCloudPrint",
+ NewCallback(this, &PrintPreviewHandler::HandlePrintWithCloudPrint));
web_ui_->RegisterMessageCallback("manageCloudPrinters",
NewCallback(this, &PrintPreviewHandler::HandleManageCloudPrint));
web_ui_->RegisterMessageCallback("manageLocalPrinters",
@@ -713,16 +715,13 @@
settings->SetBoolean(printing::kSettingHeaderFooterEnabled, false);
- bool is_cloud_printer = settings->HasKey(printing::kSettingCloudPrintId);
- bool is_cloud_dialog = settings->HasKey(printing::kSettingCloudPrintDialog);
- if (is_cloud_printer) {
+ bool print_to_cloud = settings->HasKey(printing::kSettingCloudPrintId);
+ if (print_to_cloud) {
std::string print_ticket;
args->GetString(1, &print_ticket);
SendCloudPrintJob(*settings, print_ticket);
} else if (print_to_pdf) {
HandlePrintToPdf(*settings);
- } else if (is_cloud_dialog) {
- HandlePrintWithCloudPrint();
} else {
ReportPrintSettingsStats(*settings);
ReportUserActionHistogram(PRINT_TO_PRINTER);
@@ -831,7 +830,7 @@
cloud_print_signin_dialog::CreateCloudPrintSigninDialog(preview_tab());
}
-void PrintPreviewHandler::HandlePrintWithCloudPrint() {
+void PrintPreviewHandler::HandlePrintWithCloudPrint(const ListValue* /*args*/) {
// Record the number of times the user asks to print via cloud print
// instead of the print preview dialog.
ReportStats();
« no previous file with comments | « chrome/browser/ui/webui/print_preview_handler.h ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698