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

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

Issue 7741037: Add WebstoreInlineInstaller (downloads store data, shows the install UI, and starts the install). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/extension_tab_helper.cc
diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc
index 024b4ebd14f4b3dba20ef11040bec3a7888c537f..cd8c9e33fbf75f569e7893c933a8fca4f865d142 100644
--- a/chrome/browser/extensions/extension_tab_helper.cc
+++ b/chrome/browser/extensions/extension_tab_helper.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/webstore_inline_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/restore_tab_helper.h"
#include "chrome/browser/ui/browser.h"
@@ -154,15 +155,9 @@ void ExtensionTabHelper::OnInlineWebstoreInstall(
return;
}
- // For now there is no inline installation UI, we just open the item's Web
- // Store page in a new tab.
- GURL webstore_item_url =
- GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + webstore_item_id);
- GetBrowser()->OpenURL(OpenURLParams(
- webstore_item_url,
- GetBrowser()->GetSelectedTabContents()->GetURL(),
- NEW_FOREGROUND_TAB,
- PageTransition::AUTO_BOOKMARK));
+ scoped_refptr<WebstoreInlineInstaller> installer(new WebstoreInlineInstaller(
+ tab_contents(), webstore_item_id, this));
+ installer->BeginInstall();
}
void ExtensionTabHelper::OnRequest(
@@ -213,6 +208,15 @@ Browser* ExtensionTabHelper::GetBrowser() {
return NULL;
}
+void ExtensionTabHelper::OnInlineInstallSuccess() {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(routing_id(), true, ""));
+}
+
+void ExtensionTabHelper::OnInlineInstallFailure(const std::string& error) {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(
+ routing_id(), false, error));
+}
+
TabContents* ExtensionTabHelper::GetAssociatedTabContents() const {
return tab_contents();
}

Powered by Google App Engine
This is Rietveld 408576698