| 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_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Starts a WriteFromFile operation. | 54 // Starts a WriteFromFile operation. |
| 55 void StartWriteFromFile(const ExtensionId& extension_id, | 55 void StartWriteFromFile(const ExtensionId& extension_id, |
| 56 const std::string& storage_unit_id, | 56 const std::string& storage_unit_id, |
| 57 const Operation::StartWriteCallback& callback); | 57 const Operation::StartWriteCallback& callback); |
| 58 | 58 |
| 59 // Cancels the extensions current operation if any. | 59 // Cancels the extensions current operation if any. |
| 60 void CancelWrite(const ExtensionId& extension_id, | 60 void CancelWrite(const ExtensionId& extension_id, |
| 61 const Operation::CancelWriteCallback& callback); | 61 const Operation::CancelWriteCallback& callback); |
| 62 | 62 |
| 63 // Callback for progress events. | 63 // Callback for progress events. |
| 64 void OnProgress(const ExtensionId& extension_id, | 64 virtual void OnProgress(const ExtensionId& extension_id, |
| 65 image_writer_api::Stage stage, | 65 image_writer_api::Stage stage, |
| 66 int progress); | 66 int progress); |
| 67 // Callback for completion events. | 67 // Callback for completion events. |
| 68 void OnComplete(const ExtensionId& extension_id); | 68 virtual void OnComplete(const ExtensionId& extension_id); |
| 69 | 69 |
| 70 // Callback for error events. | 70 // Callback for error events. |
| 71 // TODO (haven): Add error codes. | 71 // TODO (haven): Add error codes. |
| 72 void OnError(const ExtensionId& extension_id, | 72 virtual void OnError(const ExtensionId& extension_id, |
| 73 image_writer_api::Stage stage, | 73 image_writer_api::Stage stage, |
| 74 int progress, | 74 int progress, |
| 75 const std::string& error_message); | 75 const std::string& error_message); |
| 76 | 76 |
| 77 // ProfileKeyedAPI | 77 // ProfileKeyedAPI |
| 78 static ProfileKeyedAPIFactory<OperationManager>* | 78 static ProfileKeyedAPIFactory<OperationManager>* |
| 79 GetFactoryInstance(); | 79 GetFactoryInstance(); |
| 80 static OperationManager* Get(Profile* profile); | 80 static OperationManager* Get(Profile* profile); |
| 81 | 81 |
| 82 Profile* profile() { return profile_; } | 82 Profile* profile() { return profile_; } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 104 | 104 |
| 105 base::WeakPtrFactory<OperationManager> weak_factory_; | 105 base::WeakPtrFactory<OperationManager> weak_factory_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(OperationManager); | 107 DISALLOW_COPY_AND_ASSIGN(OperationManager); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace image_writer | 110 } // namespace image_writer |
| 111 } // namespace extensions | 111 } // namespace extensions |
| 112 | 112 |
| 113 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_
H_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_
H_ |
| OLD | NEW |