1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "chrome/service/cloud_print/print_system.h" 12 #include "url/gurl.h" 13 14 namespace cloud_print { 15 16 // Helper methods for the cloud print proxy code. 17 GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, 18 const std::string& job_id, 19 PrintJobStatus status); 20 21 GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, 22 const std::string& job_id, 23 const PrintJobDetails& details); 24 25 // Returns an MD5 hash for printer tags in the given |printer_info|. 26 std::string GetHashOfPrinterInfo( 27 const printing::PrinterBasicInfo& printer_info); 28 29 // Returns any post data for printer tags in the given |printer_info|. 30 std::string GetPostDataForPrinterInfo( 31 const printing::PrinterBasicInfo& printer_info, 32 const std::string& mime_boundary); 33 34 // Returns true if tags indicate a dry run (test) job. 35 bool IsDryRunJob(const std::vector<std::string>& tags); 36 37 // Created cloud print auth header from the auth token stored in the store. 38 std::string GetCloudPrintAuthHeaderFromStore(); 39 40 } // namespace cloud_print 41 42 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ 43