| Index: chrome/browser/component_updater/pnacl/pnacl_component_installer.h
|
| diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
|
| index 3ecf2a9cdbe6da86e3af23218e16fe8f4268312a..c2dfb870ec3b5ec2bbbdefb143b77ebea676a44c 100644
|
| --- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
|
| +++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.h
|
| @@ -5,14 +5,16 @@
|
| #ifndef CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
|
| #define CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
|
|
|
| -#include <string>
|
| +#include <list>
|
|
|
| +#include "base/callback_forward.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/files/file_path.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/version.h"
|
| #include "chrome/browser/component_updater/component_updater_service.h"
|
| #include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h"
|
| +#include "chrome/browser/component_updater/pnacl/pnacl_updater_observer.h"
|
|
|
| class CommandLine;
|
|
|
| @@ -59,12 +61,31 @@ class PnaclComponentInstaller : public ComponentInstaller {
|
|
|
| ComponentUpdateService* cus() const { return cus_; }
|
|
|
| + typedef base::Callback<void(bool)> InstallCallback;
|
| + void AddInstallCallback(const InstallCallback& cb);
|
| +
|
| + void NotifyInstallError();
|
| +
|
| + void NotifyInstallSuccess();
|
| +
|
| private:
|
| + // Cancel a particular callback after a timeout.
|
| + void CancelCallback(int callback_num);
|
| +
|
| + void NotifyAllWithResult(bool status);
|
| +
|
| bool per_user_;
|
| scoped_ptr<PnaclProfileObserver> profile_observer_;
|
| base::FilePath current_profile_path_;
|
| base::Version current_version_;
|
| ComponentUpdateService* cus_;
|
| + // Counter to issue identifiers to each callback.
|
| + int callback_nums_;
|
| + // List of callbacks to issue when an install completes successfully.
|
| + std::list<std::pair<InstallCallback, int> > install_callbacks_;
|
| + // Component updater service observer, to determine when an on-demand
|
| + // install request failed.
|
| + scoped_ptr<PnaclUpdaterObserver> updater_observer_;
|
| DISALLOW_COPY_AND_ASSIGN(PnaclComponentInstaller);
|
| };
|
|
|
| @@ -73,4 +94,11 @@ class PnaclComponentInstaller : public ComponentInstaller {
|
| bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest,
|
| base::Version* version_out);
|
|
|
| +// Ask the given component updater service to do a first-install for PNaCl.
|
| +// The |installed| callback will be run with |true| on success,
|
| +// or run with |false| on an error. The callback is called on the UI thread.
|
| +void RequestFirstInstall(ComponentUpdateService* cus,
|
| + PnaclComponentInstaller* pci,
|
| + const base::Callback<void(bool)>& installed);
|
| +
|
| #endif // CHROME_BROWSER_COMPONENT_UPDATER_PNACL_PNACL_COMPONENT_INSTALLER_H_
|
|
|