| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // shutdown. | 157 // shutdown. |
| 158 void StopUtilityClient(); | 158 void StopUtilityClient(); |
| 159 | 159 |
| 160 // Reports progress from the client, transforming from bytes to percentage. | 160 // Reports progress from the client, transforming from bytes to percentage. |
| 161 virtual void WriteImageProgress(int64 total_bytes, int64 curr_bytes); | 161 virtual void WriteImageProgress(int64 total_bytes, int64 curr_bytes); |
| 162 | 162 |
| 163 scoped_refptr<ImageWriterUtilityClient> image_writer_client_; | 163 scoped_refptr<ImageWriterUtilityClient> image_writer_client_; |
| 164 #endif | 164 #endif |
| 165 | 165 |
| 166 #if defined(OS_CHROMEOS) | 166 #if defined(OS_CHROMEOS) |
| 167 void StartWriteOnUIThread(const base::Closure& continuation); | 167 // Unmounts the volumes associated with device_path. |
| 168 | 168 void UnmountVolumes(const base::Closure& continuation); |
| 169 // Starts the write after unmounting. |
| 170 void UnmountVolumesCallback(const base::Closure& continuation, bool success); |
| 171 // Starts the ImageBurner write. Note that target_path is the file path of |
| 172 // the device where device_path has been a system device path. |
| 173 void StartWriteOnUIThread(const std::string& target_path, |
| 174 const base::Closure& continuation); |
| 169 void OnBurnFinished(const base::Closure& continuation, | 175 void OnBurnFinished(const base::Closure& continuation, |
| 170 const std::string& target_path, | 176 const std::string& target_path, |
| 171 bool success, | 177 bool success, |
| 172 const std::string& error); | 178 const std::string& error); |
| 173 void OnBurnProgress(const std::string& target_path, | 179 void OnBurnProgress(const std::string& target_path, |
| 174 int64 num_bytes_burnt, | 180 int64 num_bytes_burnt, |
| 175 int64 total_size); | 181 int64 total_size); |
| 176 void OnBurnError(); | 182 void OnBurnError(); |
| 177 #endif | 183 #endif |
| 178 | 184 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 205 | 211 |
| 206 // CleanUp operations that must be run. All these functions are run on the | 212 // CleanUp operations that must be run. All these functions are run on the |
| 207 // FILE thread. | 213 // FILE thread. |
| 208 std::vector<base::Closure> cleanup_functions_; | 214 std::vector<base::Closure> cleanup_functions_; |
| 209 }; | 215 }; |
| 210 | 216 |
| 211 } // namespace image_writer | 217 } // namespace image_writer |
| 212 } // namespace extensions | 218 } // namespace extensions |
| 213 | 219 |
| 214 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ | 220 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_H_ |
| OLD | NEW |