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

Side by Side Diff: chrome/service/cloud_print/cloud_print_helpers.h

Issue 11360151: Move common cloud print methods from service/cloud_print to common/cloud_print. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_
6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "chrome/service/cloud_print/print_system.h" 12 #include "chrome/service/cloud_print/print_system.h"
13 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
14 14
15 namespace base { 15 namespace base {
16 class DictionaryValue; 16 class DictionaryValue;
msw 2012/11/17 00:22:30 Remove this unnecessary forward decl.
Chen Yu 2012/11/26 12:07:06 Done.
17 } 17 }
18 18
19 // Helper methods for the cloud print proxy code. 19 // Helper methods for the cloud print proxy code.
20 class CloudPrintHelpers { 20 class CloudPrintHelpers {
21 public: 21 public:
22 static GURL GetUrlForPrinterRegistration(const GURL& cloud_print_server_url);
23 static GURL GetUrlForPrinterUpdate(const GURL& cloud_print_server_url,
24 const std::string& printer_id);
25 static GURL GetUrlForPrinterDelete(const GURL& cloud_print_server_url,
26 const std::string& printer_id,
27 const std::string& reason);
28 static GURL GetUrlForPrinterList(const GURL& cloud_print_server_url,
29 const std::string& proxy_id);
30 static GURL GetUrlForJobFetch(const GURL& cloud_print_server_url,
31 const std::string& printer_id,
32 const std::string& reason);
33 static GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url, 22 static GURL GetUrlForJobStatusUpdate(const GURL& cloud_print_server_url,
34 const std::string& job_id, 23 const std::string& job_id,
35 cloud_print::PrintJobStatus status); 24 cloud_print::PrintJobStatus status);
36 static GURL GetUrlForJobStatusUpdate( 25 static GURL GetUrlForJobStatusUpdate(
37 const GURL& cloud_print_server_url, 26 const GURL& cloud_print_server_url,
38 const std::string& job_id, 27 const std::string& job_id,
39 const cloud_print::PrintJobDetails& details); 28 const cloud_print::PrintJobDetails& details);
40 static GURL GetUrlForUserMessage(const GURL& cloud_print_server_url,
41 const std::string& message_id);
42 static GURL GetUrlForGetAuthCode(const GURL& cloud_print_server_url,
43 const std::string& oauth_client_id,
44 const std::string& proxy_id);
45 29
46 // Returns an MD5 hash for printer tags. 30 // Returns an MD5 hash for printer tags.
47 static std::string GetHashOfPrinterTags( 31 static std::string GetHashOfPrinterTags(
48 const printing::PrinterBasicInfo& printer); 32 const printing::PrinterBasicInfo& printer);
49 // Returns an post data for printer tags. 33 // Returns an post data for printer tags.
50 static std::string GetPostDataForPrinterTags( 34 static std::string GetPostDataForPrinterTags(
51 const printing::PrinterBasicInfo& printer_info, 35 const printing::PrinterBasicInfo& printer_info,
52 const std::string& mime_boundary); 36 const std::string& mime_boundary);
53 37
54 // Returns true is tags indicate a dry run (test) job. 38 // Returns true is tags indicate a dry run (test) job.
55 static bool IsDryRunJob(const std::vector<std::string>& tags); 39 static bool IsDryRunJob(const std::vector<std::string>& tags);
56 40
57 // Created CloudPrint auth header from the auth token stored in the store. 41 // Created CloudPrint auth header from the auth token stored in the store.
58 static std::string GetCloudPrintAuthHeaderFromStore(); 42 static std::string GetCloudPrintAuthHeaderFromStore();
59 // Created CloudPrint auth header from the auth token.
60 static std::string GetCloudPrintAuthHeader(const std::string& auth_token);
61 43
62 private: 44 private:
63 CloudPrintHelpers() {} 45 CloudPrintHelpers() {}
64 }; 46 };
65 47
66 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_ 48 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_HELPERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698