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

Unified Diff: chrome/browser/ui/browser_tab_contents.cc

Issue 23847004: "Redirecting URLs to Packaged Apps" implementation: revised (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comment in app_window_contents.cc Created 7 years, 3 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/ui/browser_tab_contents.cc
diff --git a/chrome/browser/ui/browser_tab_contents.cc b/chrome/browser/ui/browser_tab_contents.cc
index 6697a950bbbd016f379fee858b43054ce9fb502c..10d57d593b81521983b315a2cbae4260858a96b9 100644
--- a/chrome/browser/ui/browser_tab_contents.cc
+++ b/chrome/browser/ui/browser_tab_contents.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/browser_tab_contents.h"
+#include "apps/url_redirector.h"
#include "base/command_line.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
@@ -53,6 +54,7 @@
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/view_type_utils.h"
+#include "extensions/common/switches.h"
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
#include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
@@ -112,6 +114,16 @@ void BrowserTabContents::AttachTabHelpers(WebContents* web_contents) {
// helpers may rely on that.
SessionTabHelper::CreateForWebContents(web_contents);
+ // TODO(sergeygs): Remove the 'if' and update includes once url_handlers are
+ // moved out of experimental.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ extensions::switches::kEnableExperimentalExtensionApis)) {
+ // We don't want to ever send visited URLs to apps in incognito.
+ // Technically, apps are not supported in incognito, but explicitly check
+ // for that. See b/240879, which tracks incognito support for v2 apps.
+ if (!profile->IsOffTheRecord())
+ apps::UrlRedirector::CreateForWebContents(web_contents);
+ }
AlternateErrorPageTabObserver::CreateForWebContents(web_contents);
TabAutofillManagerDelegate::CreateForWebContents(web_contents);
AutofillDriverImpl::CreateForWebContentsAndDelegate(

Powered by Google App Engine
This is Rietveld 408576698