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

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

Issue 10919231: Add ability to specify list of supported mime types for Cloud Print connector in Service State file. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/print_system_cups.cc
===================================================================
--- chrome/service/cloud_print/print_system_cups.cc (revision 156165)
+++ chrome/service/cloud_print/print_system_cups.cc (working copy)
@@ -45,7 +45,13 @@
const char kCUPSPrintServerURLs[] = "print_server_urls";
const char kCUPSUpdateTimeoutMs[] = "update_timeout_ms";
const char kCUPSNotifyDelete[] = "notify_delete";
+const char kCUPSSupportedMimeTipes[] = "supported_mime_types";
+// Default mime types supported by CUPS
+// http://www.cups.org/articles.php?L205+TFAQ+Q
+const char kCUPSDefaultSupportedTypes[] =
+ "application/pdf,application/postscript,image/jpeg,image/png,image/gif";
+
// Default port for IPP print servers.
const int kDefaultIPPServerPort = 631;
@@ -169,6 +175,7 @@
bool printer_enum_succeeded_;
bool notify_delete_;
http_encryption_t cups_encryption_;
+ std::string supported_mime_types_;
};
class PrintServerWatcherCUPS
@@ -413,7 +420,8 @@
initialized_(false),
printer_enum_succeeded_(false),
notify_delete_(true),
- cups_encryption_(HTTP_ENCRYPT_NEVER) {
+ cups_encryption_(HTTP_ENCRYPT_NEVER),
+ supported_mime_types_(kCUPSDefaultSupportedTypes) {
if (print_system_settings) {
int timeout;
if (print_system_settings->GetInteger(kCUPSUpdateTimeoutMs, &timeout))
@@ -427,6 +435,10 @@
bool notify_delete = true;
if (print_system_settings->GetBoolean(kCUPSNotifyDelete, &notify_delete))
notify_delete_ = notify_delete;
+
+ std::string types;
+ if (print_system_settings->GetString(kCUPSSupportedMimeTipes, &types))
+ supported_mime_types_ = types;
}
InitPrintBackends(print_system_settings);
@@ -712,11 +724,7 @@
}
std::string PrintSystemCUPS::GetSupportedMimeTypes() {
- // Since we hand off the document to the CUPS server directly, list some types
- // that we know CUPS supports (http://www.cups.org/articles.php?L205+TFAQ+Q)
- // TODO(sanjeevr): Determine this dynamically (http://crbug.com/73240).
- return
- "application/pdf,application/postscript,image/jpeg,image/png,image/gif";
+ return supported_mime_types_;
}
std::string PrintSystem::GenerateProxyId() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698