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

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

Issue 7621032: Initial inline web store install bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback. 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
« no previous file with comments | « chrome/browser/extensions/extension_tab_helper.h ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e3dc992b841607737eed2f8db7efea2ca9eb5871..9ae06b8b9adad17d094f72c7d3cefb55c7fa29f8 100644
--- a/chrome/browser/extensions/extension_tab_helper.cc
+++ b/chrome/browser/extensions/extension_tab_helper.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/extension_tab_helper.h"
+#include "base/command_line.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/restore_tab_helper.h"
@@ -12,7 +13,9 @@
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_action.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_resource.h"
@@ -123,6 +126,8 @@ bool ExtensionTabHelper::OnMessageReceived(const IPC::Message& message) {
OnDidGetApplicationInfo)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_InstallApplication,
OnInstallApplication)
+ IPC_MESSAGE_HANDLER(ExtensionHostMsg_InlineWebstoreInstall,
+ OnInlineWebstoreInstall)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -142,6 +147,24 @@ void ExtensionTabHelper::OnInstallApplication(const WebApplicationInfo& info) {
wrapper_->delegate()->OnInstallApplication(wrapper_, info);
}
+void ExtensionTabHelper::OnInlineWebstoreInstall(
+ const std::string& webstore_item_id) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableInlineWebstoreInstall)) {
+ 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_misc::GetWebstoreItemDetailURLPrefix() + webstore_item_id);
+ GetBrowser()->OpenURL(OpenURLParams(
+ webstore_item_url,
+ GetBrowser()->GetSelectedTabContents()->GetURL(),
+ NEW_FOREGROUND_TAB,
+ PageTransition::AUTO_BOOKMARK));
+}
+
void ExtensionTabHelper::OnRequest(
const ExtensionHostMsg_Request_Params& request) {
extension_function_dispatcher_.Dispatch(request,
« no previous file with comments | « chrome/browser/extensions/extension_tab_helper.h ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698