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

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: 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 e3dc992b841607737eed2f8db7efea2ca9eb5871..e1f941a2a0ac234a383ed616520f3645fb661aff 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,6 +13,7 @@
#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_icon_set.h"
#include "chrome/common/extensions/extension_messages.h"
@@ -123,6 +125,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 +146,23 @@ 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))
Aaron Boodman 2011/08/17 04:53:03 You should use curly braces when the condition wra
Mihai Parparita -not on Chrome 2011/08/17 23:00:16 Done.
+ 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::ChromeStoreItemDetailURLPrefix() + 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,

Powered by Google App Engine
This is Rietveld 408576698