Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1521)

Unified Diff: chrome/browser/extensions/webstore_inline_installer.cc

Issue 8375034: Update WebstoreInstaller to be ref counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/webstore_inline_installer.cc
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index 6c938ec88456c95de1ec77616b9782942aa2e388..6793836debfaff2815edc56e69f139a3b3a16a8d 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -306,6 +306,7 @@ void WebstoreInlineInstaller::OnWebstoreResponseParseSuccess(
scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper(
this,
+ id_,
manifest,
"", // We don't have any icon data.
icon_url,
@@ -322,6 +323,7 @@ void WebstoreInlineInstaller::OnWebstoreResponseParseFailure(
}
void WebstoreInlineInstaller::OnWebstoreParseSuccess(
+ const std::string& id,
const SkBitmap& icon,
base::DictionaryValue* manifest) {
// Check if the tab has gone away in the meantime.
@@ -330,6 +332,7 @@ void WebstoreInlineInstaller::OnWebstoreParseSuccess(
return;
}
+ CHECK_EQ(id_, id);
manifest_.reset(manifest);
icon_ = icon;
@@ -358,6 +361,7 @@ void WebstoreInlineInstaller::OnWebstoreParseSuccess(
}
void WebstoreInlineInstaller::OnWebstoreParseFailure(
+ const std::string& id,
InstallHelperResultCode result_code,
const std::string& error_message) {
CompleteInstall(error_message);
@@ -380,10 +384,10 @@ void WebstoreInlineInstaller::InstallUIProceed() {
Profile* profile = Profile::FromBrowserContext(
tab_contents()->browser_context());
- WebstoreInstaller* installer =
- profile->GetExtensionService()->webstore_installer();
- installer->InstallExtension(
- id_, this, WebstoreInstaller::FLAG_INLINE_INSTALL);
+ scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
+ profile, this, &(tab_contents()->controller()), id_,
+ WebstoreInstaller::FLAG_INLINE_INSTALL);
+ installer->Start();
}
void WebstoreInlineInstaller::InstallUIAbort(bool user_initiated) {
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer.h ('k') | chrome/browser/extensions/webstore_install_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698