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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 1025613003: Fix for ERROR:url_pattern_set.cc(240)] Invalid url pattern: chrome://print/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 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: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 87ea7bcffdb2f02ea9e7533792d6e17ea644af20..c6bfbab831f7c3b297bfefc3d881b98fbf54f08a 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -541,6 +541,14 @@ bool ExtensionPrefs::ReadPrefAsURLPatternSet(const std::string& extension_id,
const base::ListValue* value = NULL;
if (!ReadPrefAsList(extension_id, pref_key, &value))
return false;
+ const base::DictionaryValue* extension = GetExtensionPref(extension_id);
+ if (!extension)
+ return false;
+ int location;
+ if (extension->GetInteger(kPrefLocation, &location) &&
+ static_cast<Manifest::Location>(location) == Manifest::COMPONENT) {
+ valid_schemes |= URLPattern::SCHEME_CHROMEUI;
+ }
bool allow_file_access = AllowFileAccess(extension_id);
return result->Populate(*value, valid_schemes, allow_file_access, NULL);
« chrome/browser/extensions/extension_prefs_unittest.cc ('K') | « extensions/browser/extension_prefs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698