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 namespace content { | |
24 class NotificationSource; | |
25 } | |
26 | |
23 class ComponentPatcher; | 27 class ComponentPatcher; |
24 | 28 |
25 // Component specific installers must derive from this class and implement | 29 // Component specific installers must derive from this class and implement |
26 // OnUpdateError() and Install(). A valid instance of this class must be | 30 // OnUpdateError() and Install(). A valid instance of this class must be |
27 // given to ComponentUpdateService::RegisterComponent(). | 31 // given to ComponentUpdateService::RegisterComponent(). |
28 class ComponentInstaller { | 32 class ComponentInstaller { |
29 public : | 33 public : |
30 // Called by the component updater on the UI thread when there was a | 34 // Called by the component updater on the UI thread when there was a |
31 // problem unpacking or verifying the component. |error| is a non-zero | 35 // problem unpacking or verifying the component. |error| is a non-zero |
32 // value which is only meaningful to the component updater. | 36 // value which is only meaningful to the component updater. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 // registered component, soon. If an update or check is already in progress, | 165 // registered component, soon. If an update or check is already in progress, |
162 // returns |kInProgress|. The same component cannot be checked repeatedly | 166 // returns |kInProgress|. The same component cannot be checked repeatedly |
163 // in a short interval either (returns |kError| if so). | 167 // in a short interval either (returns |kError| if so). |
164 // There is no guarantee that the item will actually be updated, | 168 // There is no guarantee that the item will actually be updated, |
165 // since another item may be chosen to be updated. Since there is | 169 // since another item may be chosen to be updated. Since there is |
166 // no time guarantee, there is no notification if the item is not updated. | 170 // no time guarantee, there is no notification if the item is not updated. |
167 // However, the ComponentInstaller should know if an update succeeded | 171 // However, the ComponentInstaller should know if an update succeeded |
168 // via the Install() hook. | 172 // via the Install() hook. |
169 virtual Status CheckForUpdateSoon(const CrxComponent& component) = 0; | 173 virtual Status CheckForUpdateSoon(const CrxComponent& component) = 0; |
170 | 174 |
175 typedef std::string UpdateSource; | |
cpu_(ooo_6.6-7.5)
2013/07/01 18:30:22
not big fan of this typedef
jvoung (off chromium)
2013/07/02 01:04:26
Ok, removed and changed back to string.
| |
176 | |
177 // Return true if a NOTIFICATION_COMPONENT_UPDATE_FOUND or | |
178 // NOTIFICATION_COMPONENT_UPDATE_READY is for the given component. | |
179 static bool IsUpdateNotificationForComponent( | |
180 const content::NotificationSource& src, | |
181 const CrxComponent& component); | |
182 | |
171 virtual ~ComponentUpdateService() {} | 183 virtual ~ComponentUpdateService() {} |
172 }; | 184 }; |
173 | 185 |
174 // Creates the component updater. You must pass a valid |config| allocated on | 186 // Creates the component updater. You must pass a valid |config| allocated on |
175 // the heap which the component updater will own. | 187 // the heap which the component updater will own. |
176 ComponentUpdateService* ComponentUpdateServiceFactory( | 188 ComponentUpdateService* ComponentUpdateServiceFactory( |
177 ComponentUpdateService::Configurator* config); | 189 ComponentUpdateService::Configurator* config); |
178 | 190 |
179 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 191 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |