1 // Copyright 2013 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_SERVICE_HELPERS_H_ 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_SERVICE_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 int connector_code); 21 22 GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, 23 const std::string& job_id, 24 const PrintJobDetails& details); 25 26 // Returns an MD5 hash for printer tags in the given |printer_info|. 27 std::string GetHashOfPrinterInfo( 28 const printing::PrinterBasicInfo& printer_info); 29 30 // Returns any post data for printer tags in the given |printer_info|. 31 std::string GetPostDataForPrinterInfo( 32 const printing::PrinterBasicInfo& printer_info, 33 const std::string& mime_boundary); 34 35 // Returns true if tags indicate a dry run (test) job. 36 bool IsDryRunJob(const std::vector<std::string>& tags); 37 38 // Created cloud print auth header from the auth token stored in the store. 39 std::string GetCloudPrintAuthHeaderFromStore(); 40 41 } // namespace cloud_print 42 43 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_SERVICE_HELPERS_H_ 44