summaryrefslogtreecommitdiffstats
path: root/chrome/browser/apps/ephemeral_app_throttle.cc
diff options
context:
space:
mode:
authortmdiep@chromium.org <tmdiep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-28 07:06:26 +0000
committertmdiep@chromium.org <tmdiep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-28 07:06:26 +0000
commitb10049955c0f05b9ef0613075b22c0f9229d4031 (patch)
tree7db15c94a896c02bc7fa14d2612b52dbd34a8ce2 /chrome/browser/apps/ephemeral_app_throttle.cc
parente9837515129ebac4c0721df39df57480f116535a (diff)
downloadchromium_src-b10049955c0f05b9ef0613075b22c0f9229d4031.zip
chromium_src-b10049955c0f05b9ef0613075b22c0f9229d4031.tar.gz
chromium_src-b10049955c0f05b9ef0613075b22c0f9229d4031.tar.bz2
Add switch enable-linkable-ephemeral-apps
Added switch "enable-linkable-ephemeral-apps" for experimentation with launching ephemeral apps from hyperlinks. This functionality was previously behind the "enable-ephemeral-apps" switch, but the two features will now be separated. This patch also ensures that only links appearing on a Google search result page will launch the app. Ephemeral apps are now enabled for Windows, Linux and ChromeOS platforms. BUG=312460 Review URL: https://codereview.chromium.org/90783002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/apps/ephemeral_app_throttle.cc')
-rw-r--r--chrome/browser/apps/ephemeral_app_throttle.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/apps/ephemeral_app_throttle.cc b/chrome/browser/apps/ephemeral_app_throttle.cc
index a5dd031..8cee382 100644
--- a/chrome/browser/apps/ephemeral_app_throttle.cc
+++ b/chrome/browser/apps/ephemeral_app_throttle.cc
@@ -80,7 +80,7 @@ EphemeralAppThrottle::MaybeCreateThrottleForLaunch(
net::URLRequest* request,
ProfileIOData* profile_io_data) {
if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableEphemeralApps))
+ switches::kEnableLinkableEphemeralApps))
return NULL;
if (request->method() != "GET" || !request->url().SchemeIsHTTPOrHTTPS())
@@ -90,6 +90,11 @@ EphemeralAppThrottle::MaybeCreateThrottleForLaunch(
if (profile_io_data->is_incognito())
return NULL;
+ // Only watch for links in Google search results.
+ if (request->referrer().find("http://www.google.com") == std::string::npos &&
+ request->referrer().find("https://www.google.com") == std::string::npos)
+ return NULL;
+
// Crudely watch for links to Chrome Web Store detail pages and assume that
// the app ID will be after the last slash of the URL. We cannot even
// differentiate between apps and extensions, so attempt to launch both.