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

Unified Diff: chrome/browser/extensions/extension_util.cc

Issue 907533004: [Extensions] Sync the 'allowed scripting on all urls' preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: chrome/browser/extensions/extension_util.cc
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc
index c4d4ce503636302118ba1ed60b8d5db543f9f88c..c0b018b1e4612f011f7efac7c722d9ff447bbcfa 100644
--- a/chrome/browser/extensions/extension_util.cc
+++ b/chrome/browser/extensions/extension_util.cc
@@ -99,6 +99,11 @@ void SetAllowedScriptingOnAllUrlsHelper(
updater.GrantWithheldImpliedAllHosts(extension);
else
updater.WithholdImpliedAllHosts(extension);
+
+ // If this was an update to permissions, we also need to sync the change.
+ ExtensionSyncService* sync_service = ExtensionSyncService::Get(context);
+ if (sync_service) // sync_service can be null in unittests.
+ sync_service->SyncExtensionChangeIfNeeded(*extension);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698