Chromium Code Reviews| Index: chrome/common/cloud_print/cloud_print_helpers.h |
| diff --git a/chrome/common/cloud_print/cloud_print_helpers.h b/chrome/common/cloud_print/cloud_print_helpers.h |
| index 1b4a15ee6011876a62081746119dc6ba864678e0..5f11f2dc1941ba56ec33373d0b1c8c2bbb9ca4c9 100644 |
| --- a/chrome/common/cloud_print/cloud_print_helpers.h |
| +++ b/chrome/common/cloud_print/cloud_print_helpers.h |
| @@ -5,22 +5,21 @@ |
| #ifndef CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ |
| #define CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ |
| +#include <map> |
| +#include <set> |
|
msw
2012/11/09 23:18:17
This looks unused here, please remove.
Chen Yu
2012/11/13 14:02:15
Done.
|
| #include <string> |
| class GURL; |
| namespace base { |
| class DictionaryValue; |
| +class ListValue; |
|
msw
2012/11/09 23:18:17
This looks unused here, please remove.
Chen Yu
2012/11/13 14:02:15
Done.
|
| } |
| // Helper consts and methods for both cloud print and chrome browser. |
| namespace cloud_print { |
| -// Values in the respone JSON from the cloud print server |
| -extern const char kPrinterListValue[]; |
| -extern const char kSuccessValue[]; |
| - |
| -extern const char kChromeCloudPrintProxyHeader[]; |
| +typedef std::map<std::string, std::string> PrinterTags; |
| // Appends a relative path to the url making sure to append a '/' if the |
| // URL's path does not end with a slash. It is assumed that |path| does not |
| @@ -32,6 +31,27 @@ std::string AppendPathToUrl(const GURL& url, const std::string& path); |
| GURL GetUrlForSearch(const GURL& cloud_print_server_url); |
| GURL GetUrlForSubmit(const GURL& cloud_print_server_url); |
| +GURL GetUrlForPrinterList(const GURL& cloud_print_server_url, |
| + const std::string& proxy_id); |
| +GURL GetUrlForPrinterRegistration(const GURL& cloud_print_server_url); |
| +GURL GetUrlForPrinterUpdate(const GURL& cloud_print_server_url, |
| + const std::string& printer_id); |
| +GURL GetUrlForPrinterDelete(const GURL& cloud_print_server_url, |
| + const std::string& printer_id, |
| + const std::string& reason); |
| +GURL GetUrlForJobFetch(const GURL& cloud_print_server_url, |
| + const std::string& printer_id, |
| + const std::string& reason); |
| +GURL GetUrlForJobDelete(const GURL& cloud_print_server_url, |
| + const std::string& job_id); |
| +GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, |
| + const std::string& job_id, |
| + const std::string& status_string); |
| +GURL GetUrlForUserMessage(const GURL& cloud_print_server_url, |
| + const std::string& message_id); |
| +GURL GetUrlForGetAuthCode(const GURL& cloud_print_server_url, |
| + const std::string& oauth_client_id, |
| + const std::string& proxy_id); |
| // Parses the response data for any cloud print server request. The method |
| // returns false if there was an error in parsing the JSON. The succeeded |
| @@ -48,9 +68,24 @@ void AddMultipartValueForUpload(const std::string& value_name, |
| const std::string& content_type, |
| std::string* post_data); |
| +// Returns the mime type of multipart with |mime_boundary|. |
| +std::string GetMultipartMimeType(const std::string& mime_boundary); |
| + |
| // Create a MIME boundary marker (27 '-' characters followed by 16 hex digits). |
| void CreateMimeBoundaryForUpload(std::string *out); |
| +// Returns an MD5 hash for printer tags from |printer_tags| and the default tags |
| +// required by cloud print server. |
| +std::string GetHashOfPrinterTags(const PrinterTags& printer_tags); |
| + |
| +// Returns an post data for printer tags from |printer_tags| and the default |
| +// tags required by cloud print server. |
| +std::string GetPostDataForPrinterTags( |
| + const PrinterTags& printer_tags, |
| + const std::string& mime_boundary, |
| + const std::string& proxy_tag_prefix, |
| + const std::string& tags_hash_tag_name); |
| + |
| } // namespace cloud_print |
| #endif // CHROME_COMMON_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ |