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

Unified Diff: chrome/service/cloud_print/cloud_print_proxy_backend.cc

Issue 2232002: Added CUPS options to the printer information. Options get uploaded to the cl... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 7 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/service/cloud_print/cloud_print_consts.cc ('k') | chrome/service/cloud_print/printer_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/cloud_print_proxy_backend.cc
===================================================================
--- chrome/service/cloud_print/cloud_print_proxy_backend.cc (revision 48213)
+++ chrome/service/cloud_print/cloud_print_proxy_backend.cc (working copy)
@@ -376,6 +376,20 @@
CloudPrintHelpers::AddMultipartValueForUpload(
kPrinterStatusValue, StringPrintf("%d", info.printer_status),
mime_boundary, std::string(), &post_data);
+ // Add printer options as tags.
+ std::map<std::string, std::string>::const_iterator it;
+ for (it = info.options.begin(); it != info.options.end(); ++it) {
+ // TODO(gene) Escape '=' char from name. Warning for now.
+ if (it->first.find('=') != std::string::npos) {
+ LOG(WARNING) << "CUPS option name contains '=' character";
+ NOTREACHED();
+ }
+ std::string msg(it->first);
+ msg += "=";
+ msg += it->second;
+ CloudPrintHelpers::AddMultipartValueForUpload(
+ kPrinterTagValue, msg, mime_boundary, std::string(), &post_data);
+ }
CloudPrintHelpers::AddMultipartValueForUpload(
kPrinterCapsValue, last_uploaded_printer_info_.printer_capabilities,
mime_boundary, last_uploaded_printer_info_.caps_mime_type,
« no previous file with comments | « chrome/service/cloud_print/cloud_print_consts.cc ('k') | chrome/service/cloud_print/printer_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698