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> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 class BurnLibrary { | 60 class BurnLibrary { |
61 public: | 61 public: |
62 class Observer { | 62 class Observer { |
63 public: | 63 public: |
64 virtual void BurnProgressUpdated(BurnLibrary* object, BurnEvent evt, | 64 virtual void BurnProgressUpdated(BurnLibrary* object, BurnEvent evt, |
65 const ImageBurnStatus& status) = 0; | 65 const ImageBurnStatus& status) = 0; |
66 }; | 66 }; |
67 | 67 |
68 virtual ~BurnLibrary() {} | 68 virtual ~BurnLibrary() {} |
69 | 69 |
| 70 virtual void Init() = 0; |
| 71 |
70 virtual void AddObserver(Observer* observer) = 0; | 72 virtual void AddObserver(Observer* observer) = 0; |
71 virtual void RemoveObserver(Observer* observer) = 0; | 73 virtual void RemoveObserver(Observer* observer) = 0; |
72 // Example values: | 74 // Example values: |
73 // DoBurn(image.bin.zip, image.bin, /dev/sdb, /sys/devices/pci..../block.sdb). | 75 // DoBurn(image.bin.zip, image.bin, /dev/sdb, /sys/devices/pci..../block.sdb). |
74 virtual void DoBurn(const FilePath& source_path, | 76 virtual void DoBurn(const FilePath& source_path, |
75 const std::string& image_name, | 77 const std::string& image_name, |
76 const FilePath& target_file_path, | 78 const FilePath& target_file_path, |
77 const FilePath& target_device_path) = 0; | 79 const FilePath& target_device_path) = 0; |
78 virtual void CancelBurnImage() = 0; | 80 virtual void CancelBurnImage() = 0; |
79 | 81 |
80 // Factory function, creates a new instance and returns ownership. | 82 // Factory function, creates a new instance and returns ownership. |
81 // For normal usage, access the singleton via CrosLibrary::Get(). | 83 // For normal usage, access the singleton via CrosLibrary::Get(). |
82 static BurnLibrary* GetImpl(bool stub); | 84 static BurnLibrary* GetImpl(bool stub); |
83 }; | 85 }; |
84 | 86 |
85 } // namespace chromeos | 87 } // namespace chromeos |
86 | 88 |
87 #endif // CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_CROS_BURN_LIBRARY_H_ |
OLD | NEW |