OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // Describes a particular component that can be installed or updated. This | 94 // Describes a particular component that can be installed or updated. This |
95 // structure is required to register a component with the component updater. | 95 // structure is required to register a component with the component updater. |
96 // |pk_hash| is the SHA256 hash of the component's public key. If the component | 96 // |pk_hash| is the SHA256 hash of the component's public key. If the component |
97 // is to be installed then version should be "0" or "0.0", else it should be | 97 // is to be installed then version should be "0" or "0.0", else it should be |
98 // the current version. |observer|, |fingerprint|, and |name| are optional. | 98 // the current version. |observer|, |fingerprint|, and |name| are optional. |
99 struct CrxComponent { | 99 struct CrxComponent { |
100 std::vector<uint8> pk_hash; | 100 std::vector<uint8> pk_hash; |
101 ComponentInstaller* installer; | 101 ComponentInstaller* installer; |
102 ComponentObserver* observer; | 102 ComponentObserver* observer; |
103 Version version; | 103 base::Version version; |
104 std::string fingerprint; | 104 std::string fingerprint; |
105 std::string name; | 105 std::string name; |
106 CrxComponent(); | 106 CrxComponent(); |
107 ~CrxComponent(); | 107 ~CrxComponent(); |
108 }; | 108 }; |
109 | 109 |
110 // This convenience function returns component id of given CrxComponent. | 110 // This convenience function returns component id of given CrxComponent. |
111 std::string GetCrxComponentID(const CrxComponent& component); | 111 std::string GetCrxComponentID(const CrxComponent& component); |
112 | 112 |
113 // Convenience structure to use with component listing / enumeration. | 113 // Convenience structure to use with component listing / enumeration. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // know the outcome of the check. | 220 // know the outcome of the check. |
221 virtual Status OnDemandUpdate(const std::string& component_id) = 0; | 221 virtual Status OnDemandUpdate(const std::string& component_id) = 0; |
222 }; | 222 }; |
223 | 223 |
224 // Creates the component updater. You must pass a valid |config| allocated on | 224 // Creates the component updater. You must pass a valid |config| allocated on |
225 // the heap which the component updater will own. | 225 // the heap which the component updater will own. |
226 ComponentUpdateService* ComponentUpdateServiceFactory( | 226 ComponentUpdateService* ComponentUpdateServiceFactory( |
227 ComponentUpdateService::Configurator* config); | 227 ComponentUpdateService::Configurator* config); |
228 | 228 |
229 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 229 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |