| 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 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const base::FilePath& /*response_file_path*/)> ResultCallback; | 57 const base::FilePath& /*response_file_path*/)> ResultCallback; |
| 58 | 58 |
| 59 virtual ~PrivetDataReadOperation() {} | 59 virtual ~PrivetDataReadOperation() {} |
| 60 | 60 |
| 61 virtual void Start() = 0; | 61 virtual void Start() = 0; |
| 62 | 62 |
| 63 virtual void SetDataRange(int range_start, int range_end) = 0; | 63 virtual void SetDataRange(int range_start, int range_end) = 0; |
| 64 | 64 |
| 65 virtual void SaveDataToFile() = 0; | 65 virtual void SaveDataToFile() = 0; |
| 66 | 66 |
| 67 // Set upload file. Only valid if the request is a PUT or POST request. |
| 68 virtual void SetUploadFile(const base::FilePath& upload_file) = 0; |
| 69 |
| 67 virtual PrivetHTTPClient* GetHTTPClient() = 0; | 70 virtual PrivetHTTPClient* GetHTTPClient() = 0; |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 // Represents a full registration flow (/privet/register), normally consisting | 73 // Represents a full registration flow (/privet/register), normally consisting |
| 71 // of calling the start action, the getClaimToken action, and calling the | 74 // of calling the start action, the getClaimToken action, and calling the |
| 72 // complete action. Some intervention from the caller is required to display the | 75 // complete action. Some intervention from the caller is required to display the |
| 73 // claim URL to the user (noted in OnPrivetRegisterClaimURL). | 76 // claim URL to the user (noted in OnPrivetRegisterClaimURL). |
| 74 class PrivetRegisterOperation { | 77 class PrivetRegisterOperation { |
| 75 public: | 78 public: |
| 76 enum FailureReason { | 79 enum FailureReason { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 const PrivetJSONOperation::ResultCallback& callback) = 0; | 189 const PrivetJSONOperation::ResultCallback& callback) = 0; |
| 187 virtual scoped_ptr<PrivetJSONOperation> CreateStorageMoveOperation( | 190 virtual scoped_ptr<PrivetJSONOperation> CreateStorageMoveOperation( |
| 188 const std::string& src_path, | 191 const std::string& src_path, |
| 189 const std::string& dest_path, | 192 const std::string& dest_path, |
| 190 const PrivetJSONOperation::ResultCallback& callback) = 0; | 193 const PrivetJSONOperation::ResultCallback& callback) = 0; |
| 191 virtual scoped_ptr<PrivetJSONOperation> CreateStorageCreateOperation( | 194 virtual scoped_ptr<PrivetJSONOperation> CreateStorageCreateOperation( |
| 192 const std::string& path, | 195 const std::string& path, |
| 193 const std::string& name, | 196 const std::string& name, |
| 194 bool is_dir, | 197 bool is_dir, |
| 195 const PrivetJSONOperation::ResultCallback& callback) = 0; | 198 const PrivetJSONOperation::ResultCallback& callback) = 0; |
| 199 virtual scoped_ptr<PrivetDataReadOperation> CreateStorageOverwriteOperation( |
| 200 const std::string& path, |
| 201 const PrivetDataReadOperation::ResultCallback& callback) = 0; |
| 196 | 202 |
| 197 // A name for the HTTP client, e.g. the device name for the privet device. | 203 // A name for the HTTP client, e.g. the device name for the privet device. |
| 198 virtual const std::string& GetName() = 0; | 204 virtual const std::string& GetName() = 0; |
| 199 }; | 205 }; |
| 200 | 206 |
| 201 } // namespace local_discovery | 207 } // namespace local_discovery |
| 202 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 208 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| OLD | NEW |