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

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

Issue 313723002: Convert local printer capabilites to CDD format to unify with cloud printers and PDF printer. This … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang reported errors. Created 6 years, 6 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/cdd_conversion_win.cc ('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/service/cloud_print/print_system_win.cc
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc
index 98a4e97880e342a5b8546699a63e0ca9f6484ba3..34d158f1539eb8bb2d64383c247eb4b59fd0e93b 100644
--- a/chrome/service/cloud_print/print_system_win.cc
+++ b/chrome/service/cloud_print/print_system_win.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/object_watcher.h"
@@ -13,6 +14,7 @@
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_hdc.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/cloud_print/cloud_print_cdd_conversion.h"
#include "chrome/common/cloud_print/cloud_print_constants.h"
#include "chrome/common/crash_keys.h"
#include "chrome/service/cloud_print/cdd_conversion_win.h"
@@ -565,7 +567,13 @@ class PrinterCapsHandler : public ServiceUtilityProcessHost::Client {
printing::PrinterCapsAndDefaults printer_info;
if (succeeded) {
printer_info.caps_mime_type = kContentTypeJSON;
- printer_info.printer_capabilities = CapabilitiesToCdd(semantic_info);
+ scoped_ptr<base::DictionaryValue> description(
+ PrinterSemanticCapsAndDefaultsToCdd(semantic_info));
+ if (description) {
+ base::JSONWriter::WriteWithOptions(
+ description.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT,
+ &printer_info.printer_capabilities);
+ }
}
callback_.Run(succeeded, printer_name, printer_info);
callback_.Reset();
« no previous file with comments | « chrome/service/cloud_print/cdd_conversion_win.cc ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698