summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/webstore_inline_installer.cc
diff options
context:
space:
mode:
authormihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-19 21:41:40 +0000
committermihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-19 21:41:40 +0000
commitcb08ba2b4460e3d873cb4fec72ad5b34fe433ff7 (patch)
tree2ffbd8329cf9b2dc6433fa6efc0d41821f763434 /chrome/browser/extensions/webstore_inline_installer.cc
parent303f3e955f35aa20c9d72769639ed8ecf25ba8f6 (diff)
downloadchromium_src-cb08ba2b4460e3d873cb4fec72ad5b34fe433ff7.zip
chromium_src-cb08ba2b4460e3d873cb4fec72ad5b34fe433ff7.tar.gz
chromium_src-cb08ba2b4460e3d873cb4fec72ad5b34fe433ff7.tar.bz2
Make inline installation callbacks fire when the item is downloaded and installed.
By having WebstoreInlineInstaller implement WebstoreInstaller::Delegate, we can respond to the callback when the item is actually installed, instead of as soon as the download is initiated. (Reland r106140: WebstoreInlineInstallUnpackFailureTest now disables the install failure UI, which was previous making the test time out on Mac and Windows) R=jstritar@chromium.org Review URL: http://codereview.chromium.org/8353015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/webstore_inline_installer.cc')
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index 967dba1..4a2ddfe 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_install_dialog.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/common/extensions/extension.h"
@@ -382,13 +381,8 @@ void WebstoreInlineInstaller::InstallUIProceed() {
WebstoreInstaller* installer =
profile->GetExtensionService()->webstore_installer();
- installer->InstallExtension(id_, NULL,
- WebstoreInstaller::FLAG_INLINE_INSTALL);
-
- // TODO(mihaip): the success message should happen later, when the extension
- // is actually downloaded and installed (by using the callbacks on
- // ExtensionInstaller::Delegate).
- CompleteInstall("");
+ installer->InstallExtension(
+ id_, this, WebstoreInstaller::FLAG_INLINE_INSTALL);
}
void WebstoreInlineInstaller::InstallUIAbort(bool user_initiated) {
@@ -403,6 +397,17 @@ void WebstoreInlineInstaller::TabContentsDestroyed(TabContents* tab_contents) {
}
}
+void WebstoreInlineInstaller::OnExtensionInstallSuccess(const std::string& id) {
+ CHECK_EQ(id_, id);
+ CompleteInstall("");
+}
+
+void WebstoreInlineInstaller::OnExtensionInstallFailure(
+ const std::string& id, const std::string& error) {
+ CHECK_EQ(id_, id);
+ CompleteInstall(error);
+}
+
void WebstoreInlineInstaller::CompleteInstall(const std::string& error) {
// Only bother responding if there's still a tab contents to send back the
// response to.