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

Unified Diff: extensions/common/permissions/settings_override_permission.cc

Issue 2086523002: Reinstate evil hack to suppress permission warnings for searchProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/permissions/settings_override_permission.cc
diff --git a/extensions/common/permissions/settings_override_permission.cc b/extensions/common/permissions/settings_override_permission.cc
index 263f9dc8299c5e0fbec85ac95fa2e1e363485388..b44d881068498df7e8f5034bc52926ec3b632961 100644
--- a/extensions/common/permissions/settings_override_permission.cc
+++ b/extensions/common/permissions/settings_override_permission.cc
@@ -51,7 +51,14 @@ bool SettingsOverrideAPIPermission::FromValue(
const base::Value* value,
std::string* /*error*/,
std::vector<std::string>* unhandled_permissions) {
- return value && value->GetAsString(&setting_value_);
+ // Ugly hack: |value| being null should be an error. But before M46 beta, we
+ // didn't store the parameter for settings override permissions in prefs.
+ // See crbug.com/533086 and crbug.com/619759.
+ // TODO(treib,devlin): Remove this for M56, when hopefully all users will have
+ // updated prefs.
+ // This should read:
+ // return value && value->GetAsString(&setting_value_);
+ return !value || value->GetAsString(&setting_value_);
}
std::unique_ptr<base::Value> SettingsOverrideAPIPermission::ToValue() const {
« no previous file with comments | « chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698