Chromium Code Reviews| Index: chrome/browser/extensions/api/settings_private/prefs_util.cc |
| diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc |
| index e32baa11f46eac2beb28f262c0c407389ba09654..75083f20321e6eeba77a23b76be31dc30a504867 100644 |
| --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc |
| +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc |
| @@ -478,6 +478,7 @@ std::unique_ptr<settings_private::PrefObject> PrefsUtil::GetPref( |
| #endif |
| const Extension* extension = GetExtensionControllingPref(*pref_object); |
| + |
| if (extension) { |
| pref_object->controlled_by = |
| settings_private::ControlledBy::CONTROLLED_BY_EXTENSION; |
| @@ -738,7 +739,12 @@ const Extension* PrefsUtil::GetExtensionControllingPref( |
| if (pref_object.key == proxy_config::prefs::kProxy) |
| return GetExtensionOverridingProxy(profile_); |
| - return nullptr; |
| + // If it's none of the above, attempt a more general strategy. |
| + std::string extension_id = |
| + ExtensionPrefValueMapFactory::GetForBrowserContext(profile_) |
| + ->GetExtensionControllingPref(pref_object.key); |
|
Dan Beam
2017/02/28 17:52:45
if (extension_id.empty())
return nullptr;
scottchen
2017/02/28 18:56:14
Done.
|
| + return ExtensionRegistry::Get(profile_)-> |
| + GetExtensionById(extension_id, ExtensionRegistry::ENABLED); |
| } |
| } // namespace extensions |