| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/local_discovery/privet_http_impl.h" | 5 #include "chrome/browser/local_discovery/privet_http_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const char kPrivetURLKeyClientName[] = "client_name"; | 38 const char kPrivetURLKeyClientName[] = "client_name"; |
| 39 const char kPrivetURLKeyJobname[] = "job_name"; | 39 const char kPrivetURLKeyJobname[] = "job_name"; |
| 40 const char kPrivetURLKeyOffline[] = "offline"; | 40 const char kPrivetURLKeyOffline[] = "offline"; |
| 41 const char kPrivetURLValueOffline[] = "1"; | 41 const char kPrivetURLValueOffline[] = "1"; |
| 42 const char kPrivetURLValueClientName[] = "Chrome"; | 42 const char kPrivetURLValueClientName[] = "Chrome"; |
| 43 | 43 |
| 44 const char kPrivetContentTypePDF[] = "application/pdf"; | 44 const char kPrivetContentTypePDF[] = "application/pdf"; |
| 45 const char kPrivetContentTypePWGRaster[] = "image/pwg-raster"; | 45 const char kPrivetContentTypePWGRaster[] = "image/pwg-raster"; |
| 46 const char kPrivetContentTypeAny[] = "*/*"; | 46 const char kPrivetContentTypeAny[] = "*/*"; |
| 47 | 47 |
| 48 const char kPrivetStorageListPath[] = "/privet/storage/list"; | |
| 49 const char kPrivetStorageContentPath[] = "/privet/storage/content"; | |
| 50 const char kPrivetStorageParamPathFormat[] = "path=%s"; | |
| 51 | |
| 52 const char kPrivetKeyJobID[] = "job_id"; | 48 const char kPrivetKeyJobID[] = "job_id"; |
| 53 | 49 |
| 54 const int kPrivetCancelationTimeoutSeconds = 3; | 50 const int kPrivetCancelationTimeoutSeconds = 3; |
| 55 | 51 |
| 56 const int kPrivetLocalPrintMaxRetries = 2; | 52 const int kPrivetLocalPrintMaxRetries = 2; |
| 57 | 53 |
| 58 const int kPrivetLocalPrintDefaultTimeout = 5; | 54 const int kPrivetLocalPrintDefaultTimeout = 5; |
| 59 | 55 |
| 60 const size_t kPrivetLocalPrintMaxJobNameLength = 64; | 56 const size_t kPrivetLocalPrintMaxJobNameLength = 64; |
| 61 | 57 |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 info_client(), kPrivetCapabilitiesPath, "", callback)); | 917 info_client(), kPrivetCapabilitiesPath, "", callback)); |
| 922 } | 918 } |
| 923 | 919 |
| 924 scoped_ptr<PrivetLocalPrintOperation> | 920 scoped_ptr<PrivetLocalPrintOperation> |
| 925 PrivetV1HTTPClientImpl::CreateLocalPrintOperation( | 921 PrivetV1HTTPClientImpl::CreateLocalPrintOperation( |
| 926 PrivetLocalPrintOperation::Delegate* delegate) { | 922 PrivetLocalPrintOperation::Delegate* delegate) { |
| 927 return scoped_ptr<PrivetLocalPrintOperation>( | 923 return scoped_ptr<PrivetLocalPrintOperation>( |
| 928 new PrivetLocalPrintOperationImpl(info_client(), delegate)); | 924 new PrivetLocalPrintOperationImpl(info_client(), delegate)); |
| 929 } | 925 } |
| 930 | 926 |
| 931 scoped_ptr<PrivetJSONOperation> | |
| 932 PrivetV1HTTPClientImpl::CreateStorageListOperation( | |
| 933 const std::string& path, | |
| 934 const PrivetJSONOperation::ResultCallback& callback) { | |
| 935 std::string url_param = | |
| 936 base::StringPrintf(kPrivetStorageParamPathFormat, path.c_str()); | |
| 937 return scoped_ptr<PrivetJSONOperation>(new PrivetJSONOperationImpl( | |
| 938 info_client(), kPrivetStorageListPath, url_param, callback)); | |
| 939 } | |
| 940 | |
| 941 scoped_ptr<PrivetDataReadOperation> | |
| 942 PrivetV1HTTPClientImpl::CreateStorageReadOperation( | |
| 943 const std::string& path, | |
| 944 const PrivetDataReadOperation::ResultCallback& callback) { | |
| 945 std::string url_param = | |
| 946 base::StringPrintf(kPrivetStorageParamPathFormat, path.c_str()); | |
| 947 return scoped_ptr<PrivetDataReadOperation>(new PrivetDataReadOperationImpl( | |
| 948 info_client(), kPrivetStorageContentPath, url_param, callback)); | |
| 949 } | |
| 950 | |
| 951 } // namespace local_discovery | 927 } // namespace local_discovery |
| OLD | NEW |