Chromium Code Reviews| Index: chrome/browser/component_updater/component_updater_service.h |
| diff --git a/chrome/browser/component_updater/component_updater_service.h b/chrome/browser/component_updater/component_updater_service.h |
| index 7125ff417534eb13c79a26355f9e274abfa3a5fd..95071facfce40628128431ab6bd0cd7e152ebde7 100644 |
| --- a/chrome/browser/component_updater/component_updater_service.h |
| +++ b/chrome/browser/component_updater/component_updater_service.h |
| @@ -50,6 +50,32 @@ class ComponentInstaller { |
| virtual ~ComponentInstaller() {} |
| }; |
| +// Defines an interface to observe a CrxComponent. |
| +class ComponentObserver { |
| + public: |
| + enum Events { |
| + // Sent when the component updater starts doing update checks. |
| + COMPONENT_UPDATER_STARTED, |
| + |
| + // Sent when the component updater is going to take a long nap. |
| + COMPONENT_UPDATER_SLEEPING, |
| + |
| + // Sent when there is a new version of a registered component. After |
| + // the notification is send the component will be downloaded. |
|
waffles
2013/07/31 01:31:30
send -> sent
Sorin Jianu
2013/07/31 01:38:58
Done.
|
| + COMPONENT_UPDATE_FOUND, |
| + |
| + // Send when the new component has been downloaded and an installation |
|
waffles
2013/07/31 01:31:30
Send -> Sent
Sorin Jianu
2013/07/31 01:38:58
Done.
|
| + // or upgrade is about to be attempted. |
| + COMPONENT_UPDATE_READY, |
| + }; |
| + |
| + virtual ~ComponentObserver() {} |
| + |
| + // The component updater service will call this function when an interesting |
| + // event happens for a specific component. |extra| is |event| dependent. |
| + virtual void OnEvent(Events event, int extra) = 0; |
| +}; |
| + |
| // Describes a particular component that can be installed or updated. This |
| // structure is required to register a component with the component updater. |
| // |pk_hash| is the SHA256 hash of the component's public key. If the component |
| @@ -58,6 +84,7 @@ class ComponentInstaller { |
| struct CrxComponent { |
| std::vector<uint8> pk_hash; |
| ComponentInstaller* installer; |
| + ComponentObserver* observer; |
| Version version; |
| std::string fingerprint; |
| std::string name; |