| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
| 6 #ifndef CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ | 6 #ifndef CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ |
| 7 #define CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ | 7 #define CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "chrome/browser/chromeos/cros/mount_library.h" | 16 #include "chrome/browser/chromeos/cros/mount_library.h" |
| 17 #include "third_party/cros/chromeos_imageburn.h" | 17 #include "third_party/cros/chromeos_imageburn.h" |
| 18 | 18 |
| 19 struct ImageBurnStatus { | 19 struct ImageBurnStatus { |
| 20 ImageBurnStatus() : target_path(), | 20 ImageBurnStatus() : target_path(), |
| 21 amount_burnt(0), | 21 amount_burnt(0), |
| 22 total_size(0), | 22 total_size(0), |
| 23 error() { | 23 error() { |
| 24 } | 24 } |
| 25 | 25 |
| 26 explicit ImageBurnStatus(const chromeos::BurnStatus& status) | 26 explicit ImageBurnStatus(const chromeos::BurnStatus& status) |
| 27 : amount_burnt(status.amount_burnt), | 27 : amount_burnt(status.amount_burnt), total_size(status.total_size) { |
| 28 total_size(status.total_size) { | |
| 29 if (status.target_path) | 28 if (status.target_path) |
| 30 target_path = status.target_path; | 29 target_path = status.target_path; |
| 31 if (status.error) | 30 if (status.error) |
| 32 error = status.error; | 31 error = status.error; |
| 33 } | 32 } |
| 34 | 33 |
| 35 explicit ImageBurnStatus(const char* path, int64 burnt, int64 total, | 34 ImageBurnStatus(const char* path, int64 burnt, int64 total, const char* err) |
| 36 const char* err) : total_size(total) { | 35 : total_size(total) { |
| 37 if (path) | 36 if (path) |
| 38 target_path = path; | 37 target_path = path; |
| 39 if (err) | 38 if (err) |
| 40 error = err; | 39 error = err; |
| 41 } | 40 } |
| 42 | 41 |
| 43 std::string target_path; | 42 std::string target_path; |
| 44 int64 amount_burnt; | 43 int64 amount_burnt; |
| 45 int64 total_size; | 44 int64 total_size; |
| 46 std::string error; | 45 std::string error; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 virtual void CancelBurnImage() = 0; | 78 virtual void CancelBurnImage() = 0; |
| 80 | 79 |
| 81 // Factory function, creates a new instance and returns ownership. | 80 // Factory function, creates a new instance and returns ownership. |
| 82 // For normal usage, access the singleton via CrosLibrary::Get(). | 81 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 83 static BurnLibrary* GetImpl(bool stub); | 82 static BurnLibrary* GetImpl(bool stub); |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 } // namespace chromeos | 85 } // namespace chromeos |
| 87 | 86 |
| 88 #endif // CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ | 87 #endif // CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ |
| OLD | NEW |