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

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

Issue 10907104: Support an --install-from-webstore command line switch (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: updated comment 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/tab_helper.cc
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index 52b7656aea8fc58a077adba8575fb31723374270..1d1433a451e54e2d7aa00421a6d6a6f131eecddf 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -245,13 +245,15 @@ void TabHelper::OnInlineWebstoreInstall(
int return_route_id,
const std::string& webstore_item_id,
const GURL& requestor_url) {
+ WebstoreInlineInstaller::Callback callback =
+ base::Bind(&TabHelper::OnInlineInstallComplete, base::Unretained(this),
+ install_id, return_route_id);
scoped_refptr<WebstoreInlineInstaller> installer(new WebstoreInlineInstaller(
web_contents(),
- install_id,
- return_route_id,
webstore_item_id,
+ true,
requestor_url,
- this));
+ callback));
installer->BeginInstall();
}
@@ -401,16 +403,17 @@ WindowController* TabHelper::GetExtensionWindowController() const {
return ExtensionTabUtil::GetWindowControllerOfTab(web_contents());
}
-void TabHelper::OnInlineInstallSuccess(int install_id, int return_route_id) {
- Send(new ExtensionMsg_InlineWebstoreInstallResponse(
- return_route_id, install_id, true, ""));
-}
-
-void TabHelper::OnInlineInstallFailure(int install_id,
- int return_route_id,
- const std::string& error) {
- Send(new ExtensionMsg_InlineWebstoreInstallResponse(
- return_route_id, install_id, false, error));
+void TabHelper::OnInlineInstallComplete(int install_id,
+ int return_route_id,
+ bool success,
+ const std::string& error) {
+ if (success) {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(
+ return_route_id, install_id, true, ""));
+ } else {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(
+ return_route_id, install_id, false, error));
+ }
}
WebContents* TabHelper::GetAssociatedWebContents() const {

Powered by Google App Engine
This is Rietveld 408576698