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

Unified Diff: apps/app_window_contents.cc

Issue 23847004: "Redirecting URLs to Packaged Apps" implementation: revised (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: apps/app_window_contents.cc
diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc
index d163c2ce84ace7bce1cdb270d9412ce4e87b2d98..46b30cf1d8feb388dbb37f2a19702f4a9ca65763 100644
--- a/apps/app_window_contents.cc
+++ b/apps/app_window_contents.cc
@@ -5,6 +5,7 @@
#include "apps/app_window_contents.h"
#include "apps/native_app_window.h"
+#include "apps/url_redirector.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/app_window.h"
@@ -137,6 +138,8 @@ bool AppWindowContents::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AppWindowContents, message)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest)
+ IPC_MESSAGE_HANDLER(ExtensionHostMsg_RedirectUrl,
+ LaunchAppWithUrl)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions,
UpdateDraggableRegions)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -164,6 +167,13 @@ void AppWindowContents::UpdateDraggableRegions(
host_->UpdateDraggableRegions(regions);
}
+void AppWindowContents::LaunchAppWithUrl(const GURL& url,
+ const GURL& referrer_url) const {
+ UrlRedirector::MaybeLaunchAppWithUrl(
benwells 2013/09/03 01:10:56 Can you just create a UrlRedirector tab helper thi
sergeygs 2013/09/03 06:15:24 Great advice, thanks, I just didn't find that on m
+ Profile::FromBrowserContext(web_contents_->GetBrowserContext()),
+ url, referrer_url);
+}
+
void AppWindowContents::SuspendRenderViewHost(
content::RenderViewHost* rvh) {
DCHECK(rvh);
« no previous file with comments | « apps/app_window_contents.h ('k') | apps/apps.gypi » ('j') | apps/url_redirector.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698