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

Unified Diff: chrome/browser/extensions/extension_dom_ui.cc

Issue 1940002: Prevent chrome extension URL overrides from applying in incognito mode. (Closed)
Patch Set: Created 10 years, 8 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_dom_ui.cc
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc
index b553b85d7d55bf345b29a04c93ca04e17a12bf82..4776e9c8a61d91beb4e356ebaa0da39141c624f5 100644
--- a/chrome/browser/extensions/extension_dom_ui.cc
+++ b/chrome/browser/extensions/extension_dom_ui.cc
@@ -163,10 +163,8 @@ bool ExtensionDOMUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
if (!url->SchemeIs(chrome::kChromeUIScheme))
return false;
- // Even when the extensions service is enabled by default, it's still
- // disabled in incognito mode.
- ExtensionsService* service = profile->GetExtensionsService();
- if (!service)
+ // We can't handle chrome-extension URLs in incognito mode.
+ if (profile->IsOffTheRecord())
return false;
const DictionaryValue* overrides =
@@ -176,6 +174,7 @@ bool ExtensionDOMUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
if (!overrides || !overrides->GetList(UTF8ToWide(page), &url_list))
return false;
+ ExtensionsService* service = profile->GetExtensionsService();
if (!service->is_ready()) {
// TODO(erikkay) So far, it looks like extensions load before the new tab
// page. I don't know if we have anything that enforces this, so add this

Powered by Google App Engine
This is Rietveld 408576698