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 |