summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_dom_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_dom_ui.cc')
-rw-r--r--chrome/browser/extensions/extension_dom_ui.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc
index 62cfee0..659eb98 100644
--- a/chrome/browser/extensions/extension_dom_ui.cc
+++ b/chrome/browser/extensions/extension_dom_ui.cc
@@ -222,10 +222,6 @@ bool ExtensionDOMUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
if (!url->SchemeIs(chrome::kChromeUIScheme))
return false;
- // We can't handle chrome-extension URLs in incognito mode.
- if (profile->IsOffTheRecord())
- return false;
-
const DictionaryValue* overrides =
profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
std::string page = url->host();
@@ -242,9 +238,10 @@ bool ExtensionDOMUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
return false;
}
- while (url_list->GetSize()) {
- Value* val;
- url_list->Get(0, &val);
+ size_t i = 0;
+ while (i < url_list->GetSize()) {
+ Value* val = NULL;
+ url_list->Get(i, &val);
// Verify that the override value is good. If not, unregister it and find
// the next one.
@@ -272,6 +269,16 @@ bool ExtensionDOMUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
continue;
}
+ // We can't handle chrome-extension URLs in incognito mode unless the
+ // extension uses split mode.
+ bool incognito_override_allowed =
+ extension->incognito_split_mode() &&
+ service->IsIncognitoEnabled(extension);
+ if (profile->IsOffTheRecord() && !incognito_override_allowed) {
+ ++i;
+ continue;
+ }
+
*url = extension_url;
return true;
}