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

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

Issue 10920084: don't display platform app resources in normal browser windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 0b41fdaf58a7332a090f3a77a2b9490bf0a1d23b..092bf37b76c0ca90dcbd5e2f7b5558cc47f3faaf 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -326,6 +326,13 @@ bool SwapInPrerender(TabContents* target_contents, const GURL& url) {
prerender_manager->MaybeUsePrerenderedPage(web_contents, url);
}
+// Returns true if |url| is something we should try to avoid showing as a main
+// frame in a normal browser window.
+bool ShouldNotDisplayUrlInBrowser(Profile* profile, const GURL& url) {
+ ExtensionService* service = profile->GetExtensionService();
+ return service && service->ShouldNotDisplayUrlInBrowserTab(url);
+}
+
} // namespace
namespace chrome {
@@ -393,6 +400,9 @@ void Navigate(NavigateParams* params) {
if (!AdjustNavigateParamsForURL(params))
return;
+ if (ShouldNotDisplayUrlInBrowser(params->initiating_profile, params->url))
+ return;
+
// The browser window may want to adjust the disposition.
if (params->disposition == NEW_POPUP &&
source_browser &&

Powered by Google App Engine
This is Rietveld 408576698