1f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_SERVICE_HELPERS_H_
6f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_SERVICE_HELPERS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/service/cloud_print/print_system.h"
127dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "url/gurl.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace cloud_print {
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Helper methods for the cloud print proxy code.
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url,
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                              const std::string& job_id,
1968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                              PrintJobStatus status,
2068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)                              int connector_code);
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url,
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                              const std::string& job_id,
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                              const PrintJobDetails& details);
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Returns an MD5 hash for printer tags in the given |printer_info|.
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)std::string GetHashOfPrinterInfo(
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const printing::PrinterBasicInfo& printer_info);
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Returns any post data for printer tags in the given |printer_info|.
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)std::string GetPostDataForPrinterInfo(
322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const printing::PrinterBasicInfo& printer_info,
332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const std::string& mime_boundary);
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Returns true if tags indicate a dry run (test) job.
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool IsDryRunJob(const std::vector<std::string>& tags);
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Created cloud print auth header from the auth token stored in the store.
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)std::string GetCloudPrintAuthHeaderFromStore();
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace cloud_print
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
43f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif  // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_SERVICE_HELPERS_H_
44