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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 10911158: Pass on download or installation errors from WebstoreInstaller to the CompleteInstall function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and rename error204->empty Created 8 years, 3 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/api/webstore_private/webstore_private_api.cc
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index 6aae05497f1fa645c68d63aa4df6cf40d27514f2..8fa1fbf5e44cebbd9d93b4a55aa83e94aafd13ed 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -438,10 +438,12 @@ bool CompleteInstallFunction::RunImpl() {
return false;
}
+ AddRef();
+
// The extension will install through the normal extension install flow, but
// the whitelist entry will bypass the normal permissions install dialog.
scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
- profile(), test_webstore_installer_delegate,
+ profile(), this,
&(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()),
id, approval.Pass(), WebstoreInstaller::FLAG_NONE);
installer->Start();
@@ -449,6 +451,30 @@ bool CompleteInstallFunction::RunImpl() {
return true;
}
+void CompleteInstallFunction::OnExtensionInstallSuccess(
+ const std::string& id) {
+ if (test_webstore_installer_delegate)
+ test_webstore_installer_delegate->OnExtensionInstallSuccess(id);
+
+ SendResponse(true);
+
+ // Matches the AddRef in RunImpl().
+ Release();
+}
+
+void CompleteInstallFunction::OnExtensionInstallFailure(
+ const std::string& id, const std::string& error) {
+ if (test_webstore_installer_delegate)
+ test_webstore_installer_delegate->OnExtensionInstallFailure(id, error);
+
+ error_ = error;
+ SendResponse(false);
+
+ // Matches the AddRef in RunImpl().
+ Release();
+}
+
+
bool GetBrowserLoginFunction::RunImpl() {
SetResult(CreateLoginResult(profile_->GetOriginalProfile()));
return true;

Powered by Google App Engine
This is Rietveld 408576698