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 |
11 #include "base/version.h" | 11 #include "base/version.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
16 } | 16 } |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 class FilePath; | 20 class FilePath; |
21 } | 21 } |
22 | 22 |
23 // Component specific installers must derive from this class and implement | 23 // Component specific installers must derive from this class and implement |
24 // OnUpdateError() and Install(). A valid instance of this class must be | 24 // OnUpdateError() and Install(). A valid instance of this class must be |
25 // given to ComponentUpdateService::RegisterComponent(). | 25 // given to ComponentUpdateService::RegisterComponent(). |
26 class ComponentInstaller { | 26 class ComponentInstaller { |
27 public : | 27 public : |
28 // Called by the component updater on the UI thread when there was a | 28 // Called by the component updater on the UI thread when there was a |
29 // problem unpacking or verifying the component. |error| is a non-zero | 29 // problem unpacking or verifying the component. |error| is a non-zero |
30 // value which is only meaninful to the component updater. | 30 // value which is only meaningful to the component updater. |
31 virtual void OnUpdateError(int error) = 0; | 31 virtual void OnUpdateError(int error) = 0; |
32 | 32 |
33 // Called by the component updater when a component has been unpacked | 33 // Called by the component updater when a component has been unpacked |
34 // and is ready to be installed. |manifest| contains the CRX manifest | 34 // and is ready to be installed. |manifest| contains the CRX manifest |
35 // json dictionary and |unpack_path| contains the temporary directory | 35 // json dictionary and |unpack_path| contains the temporary directory |
36 // with all the unpacked CRX files. | 36 // with all the unpacked CRX files. |
37 virtual bool Install(base::DictionaryValue* manifest, | 37 virtual bool Install(base::DictionaryValue* manifest, |
38 const base::FilePath& unpack_path) = 0; | 38 const base::FilePath& unpack_path) = 0; |
39 | 39 |
40 protected: | 40 protected: |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 virtual ~ComponentUpdateService() {} | 156 virtual ~ComponentUpdateService() {} |
157 }; | 157 }; |
158 | 158 |
159 // Creates the component updater. You must pass a valid |config| allocated on | 159 // Creates the component updater. You must pass a valid |config| allocated on |
160 // the heap which the component updater will own. | 160 // the heap which the component updater will own. |
161 ComponentUpdateService* ComponentUpdateServiceFactory( | 161 ComponentUpdateService* ComponentUpdateServiceFactory( |
162 ComponentUpdateService::Configurator* config); | 162 ComponentUpdateService::Configurator* config); |
163 | 163 |
164 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 164 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |