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

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: Put webstore response in the right directory. 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..6a2a391c7b15a3a9fcfe1e59a57d58aa5ce968a3 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,22 +208,17 @@ Browser* ExtensionTabHelper::GetBrowser() {
return NULL;
}
-TabContents* ExtensionTabHelper::GetAssociatedTabContents() const {
- return tab_contents();
+void ExtensionTabHelper::OnInlineInstallSuccess() {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(routing_id(), true, ""));
}
-gfx::NativeWindow ExtensionTabHelper::GetCustomFrameNativeWindow() {
- if (GetBrowser())
- return NULL;
+void ExtensionTabHelper::OnInlineInstallFailure(const std::string& error) {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(
+ routing_id(), false, error));
+}
- // If there was no browser associated with the function dispatcher delegate,
- // then this WebUI may be hosted in an ExternalTabContainer, and a framing
- // window will be accessible through the tab_contents.
- TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate();
- if (tab_contents_delegate)
- return tab_contents_delegate->GetFrameNativeWindow();
- else
- return NULL;
+TabContents* ExtensionTabHelper::GetAssociatedTabContents() const {
+ return tab_contents();
}
gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() {
« no previous file with comments | « chrome/browser/extensions/extension_tab_helper.h ('k') | chrome/browser/extensions/extension_webstore_private_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698