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

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: Adding test case. 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..21eedf3f43053a3b12901b81bd7e3021546ecb36 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -541,6 +541,22 @@ bool ExtensionPrefs::ReadPrefAsURLPatternSet(const std::string& extension_id,
const base::ListValue* value = NULL;
if (!ReadPrefAsList(extension_id, pref_key, &value))
return false;
+ /*
+ scoped_ptr<ExtensionInfo> installed_extension =
+ GetInstalledExtensionInfo(extension_id);
+ if (!installed_extension.get())
+ return false;
+ if (installed_extension->extension_location == Manifest::COMPONENT)
+ valid_schemes |= URLPattern::SCHEME_CHROMEUI;
+ */
+ const base::DictionaryValue* extensions = GetExtensionPref(extension_id);
not at google - send to devlin 2015/04/09 14:56:07 "extension", not "extensions".
Deepak 2015/04/10 05:16:34 Done.
+ if (!extensions)
+ return false;
+ int location_value;
not at google - send to devlin 2015/04/09 14:56:07 just "location"?
Deepak 2015/04/10 05:16:34 Done.
+ if (extensions->GetInteger(kPrefLocation, &location_value) &&
+ static_cast<Manifest::Location>(location_value) == 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