summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_install_ui.h
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 22:53:47 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 22:53:47 +0000
commit86693068111d56f16fd2ceee6bb87ac72030e371 (patch)
treeeaab33bc7911a31d022781ec35b7fe1efbfffadc /chrome/browser/extensions/extension_install_ui.h
parentf1aadb738b716d2e32392023b9eb7b75eac59f07 (diff)
downloadchromium_src-86693068111d56f16fd2ceee6bb87ac72030e371.zip
chromium_src-86693068111d56f16fd2ceee6bb87ac72030e371.tar.gz
chromium_src-86693068111d56f16fd2ceee6bb87ac72030e371.tar.bz2
Show the extension install UI when the user clicks Reenable for a disabled-on-upgrade extension.
Also fix a couple misc bugs with disabled extensions: - Fix a crash when trying to reenable an uninstalled disabled extension. - Fix a bug where upgrading a disabled extension would reenable it. BUG=12140 TEST=no Review URL: http://codereview.chromium.org/172006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_install_ui.h')
-rw-r--r--chrome/browser/extensions/extension_install_ui.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h
index 6ca224d..1914989 100644
--- a/chrome/browser/extensions/extension_install_ui.h
+++ b/chrome/browser/extensions/extension_install_ui.h
@@ -8,32 +8,55 @@
#include "base/file_path.h"
#include "base/gfx/native_widget_types.h"
#include "base/ref_counted.h"
-#include "chrome/browser/extensions/crx_installer.h"
+class Extension;
class ExtensionsService;
class MessageLoop;
class Profile;
class SandboxedExtensionUnpacker;
+class SkBitmap;
// Displays all the UI around extension installation.
-class ExtensionInstallUI : public CrxInstallerClient {
+class ExtensionInstallUI {
public:
+ class Delegate {
+ public:
+ // We call this method after ConfirmInstall() to signal that the
+ // installation should continue.
+ virtual void ContinueInstall() = 0;
+
+ // We call this method after ConfirmInstall() to signal that the
+ // installation should stop.
+ virtual void AbortInstall() = 0;
+ };
+
// NOTE: The implementation of this is platform-specific.
static void ShowExtensionInstallPrompt(Profile* profile,
- CrxInstaller* installer,
+ Delegate* delegate,
Extension* extension,
SkBitmap* install_icon);
ExtensionInstallUI(Profile* profile);
- private:
- // CrxInstallerClient
- virtual void ConfirmInstall(CrxInstaller* installer, Extension* extension,
- SkBitmap* icon);
- virtual void OnInstallSuccess(Extension* extension);
- virtual void OnInstallFailure(const std::string& error);
- virtual void OnOverinstallAttempted(Extension* extension);
+ // This is called by the installer to verify whether the installation should
+ // proceed.
+ //
+ // We *MUST* eventually call either ContinueInstall() or AbortInstall()
+ // on |delegate|.
+ void ConfirmInstall(Delegate* delegate, Extension* extension,
+ SkBitmap* icon);
+
+ // Installation was successful.
+ void OnInstallSuccess(Extension* extension);
+ // Intallation failed.
+ void OnInstallFailure(const std::string& error);
+
+ // The install was rejected because the same extension/version is already
+ // installed.
+ void OnOverinstallAttempted(Extension* extension);
+
+ private:
void ShowThemeInfoBar(Extension* new_theme);
Profile* profile_;