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_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void Cancel(); | 66 void Cancel(); |
67 | 67 |
68 // Aborts the operation, cancelling it and generating an error. | 68 // Aborts the operation, cancelling it and generating an error. |
69 void Abort(); | 69 void Abort(); |
70 | 70 |
71 // Informational getters. | 71 // Informational getters. |
72 int GetProgress(); | 72 int GetProgress(); |
73 image_writer_api::Stage GetStage(); | 73 image_writer_api::Stage GetStage(); |
74 | 74 |
75 #if !defined(OS_CHROMEOS) | 75 #if !defined(OS_CHROMEOS) |
76 // Set an ImageWriterClient to use. Should be called only when testing. | 76 // Set an ImageWriterClient to use. Should be called only when testing. This |
77 void SetUtilityClientForTesting( | 77 // does not set up automatic shutdown of the client and it must be shutdown |
| 78 // manually. |
| 79 static void SetUtilityClientForTesting( |
78 scoped_refptr<ImageWriterUtilityClient> client); | 80 scoped_refptr<ImageWriterUtilityClient> client); |
79 #endif | 81 #endif |
80 | 82 |
81 protected: | 83 protected: |
82 virtual ~Operation(); | 84 virtual ~Operation(); |
83 | 85 |
84 // This function should be overriden by subclasses to set up the work of the | 86 // This function should be overriden by subclasses to set up the work of the |
85 // operation. It will be called from Start(). | 87 // operation. It will be called from Start(). |
86 virtual void StartImpl() = 0; | 88 virtual void StartImpl() = 0; |
87 | 89 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 213 |
212 // CleanUp operations that must be run. All these functions are run on the | 214 // CleanUp operations that must be run. All these functions are run on the |
213 // FILE thread. | 215 // FILE thread. |
214 std::vector<base::Closure> cleanup_functions_; | 216 std::vector<base::Closure> cleanup_functions_; |
215 }; | 217 }; |
216 | 218 |
217 } // namespace image_writer | 219 } // namespace image_writer |
218 } // namespace extensions | 220 } // namespace extensions |
219 | 221 |
220 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ | 222 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ |
OLD | NEW |