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 27 matching lines...) Expand all Loading... |
38 typedef std::string ExtensionId; | 38 typedef std::string ExtensionId; |
39 | 39 |
40 explicit OperationManager(Profile* profile); | 40 explicit OperationManager(Profile* profile); |
41 virtual ~OperationManager(); | 41 virtual ~OperationManager(); |
42 | 42 |
43 virtual void Shutdown() OVERRIDE; | 43 virtual void Shutdown() OVERRIDE; |
44 | 44 |
45 // Starts a WriteFromUrl operation. | 45 // Starts a WriteFromUrl operation. |
46 void StartWriteFromUrl(const ExtensionId& extension_id, | 46 void StartWriteFromUrl(const ExtensionId& extension_id, |
47 GURL url, | 47 GURL url, |
| 48 content::RenderViewHost* rvh, |
48 const std::string& hash, | 49 const std::string& hash, |
49 const std::string& device_path, | 50 bool saveImageAsDownload, |
| 51 const std::string& storage_unit_id, |
50 const Operation::StartWriteCallback& callback); | 52 const Operation::StartWriteCallback& callback); |
51 | 53 |
52 // Starts a WriteFromFile operation. | 54 // Starts a WriteFromFile operation. |
53 void StartWriteFromFile(const ExtensionId& extension_id, | 55 void StartWriteFromFile(const ExtensionId& extension_id, |
54 const base::FilePath& path, | 56 const base::FilePath& path, |
55 const std::string& device_path, | 57 const std::string& storage_unit_id, |
56 const Operation::StartWriteCallback& callback); | 58 const Operation::StartWriteCallback& callback); |
57 | 59 |
58 // Cancels the extensions current operation if any. | 60 // Cancels the extensions current operation if any. |
59 void CancelWrite(const ExtensionId& extension_id, | 61 void CancelWrite(const ExtensionId& extension_id, |
60 const Operation::CancelWriteCallback& callback); | 62 const Operation::CancelWriteCallback& callback); |
61 | 63 |
62 // Starts a write that removes the partition table. | 64 // Starts a write that removes the partition table. |
63 void DestroyPartitions(const ExtensionId& extension_id, | 65 void DestroyPartitions(const ExtensionId& extension_id, |
64 const std::string& device_path, | 66 const std::string& storage_unit_id, |
65 const Operation::StartWriteCallback& callback); | 67 const Operation::StartWriteCallback& callback); |
66 | 68 |
67 // Callback for progress events. | 69 // Callback for progress events. |
68 virtual void OnProgress(const ExtensionId& extension_id, | 70 virtual void OnProgress(const ExtensionId& extension_id, |
69 image_writer_api::Stage stage, | 71 image_writer_api::Stage stage, |
70 int progress); | 72 int progress); |
71 // Callback for completion events. | 73 // Callback for completion events. |
72 virtual void OnComplete(const ExtensionId& extension_id); | 74 virtual void OnComplete(const ExtensionId& extension_id); |
73 | 75 |
74 // Callback for error events. | 76 // Callback for error events. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 109 |
108 base::WeakPtrFactory<OperationManager> weak_factory_; | 110 base::WeakPtrFactory<OperationManager> weak_factory_; |
109 | 111 |
110 DISALLOW_COPY_AND_ASSIGN(OperationManager); | 112 DISALLOW_COPY_AND_ASSIGN(OperationManager); |
111 }; | 113 }; |
112 | 114 |
113 } // namespace image_writer | 115 } // namespace image_writer |
114 } // namespace extensions | 116 } // namespace extensions |
115 | 117 |
116 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_
H_ | 118 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_
H_ |
OLD | NEW |