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

Unified Diff: chrome/browser/extensions/permissions_updater.h

Issue 2499493004: Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Add URLPattern effective TLD whitelisting, Switched IPC to UpdatePermissions, Removed shared memor… Created 3 years, 11 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/permissions_updater.h
diff --git a/chrome/browser/extensions/permissions_updater.h b/chrome/browser/extensions/permissions_updater.h
index 2bb6f8fe2f9d62149afdbffad1b3e4e0f051ed2d..030b77b73c76ebfb10e9b3b7eecf72b130f5779d 100644
--- a/chrome/browser/extensions/permissions_updater.h
+++ b/chrome/browser/extensions/permissions_updater.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/shared_memory.h"
Devlin 2017/01/26 22:47:39 needed?
nrpeter 2017/02/03 19:32:24 Done.
#include "extensions/browser/extension_event_histogram_value.h"
namespace base {
@@ -24,6 +25,7 @@ namespace extensions {
class Extension;
class ExtensionPrefs;
class PermissionSet;
+class URLPatternSet;
// Updates an Extension's active and granted permissions in persistent storage
// and notifies interested parties of the changes.
@@ -69,6 +71,21 @@ class PermissionsUpdater {
void RemovePermissionsUnsafe(const Extension* extension,
const PermissionSet& permissions);
+ // Sets list of hosts |extension| may not interact with (overrides default).
+ // This is the individual scope of ExtensionSettings.
+ void SetPolicyHostRestrictions(const Extension* extension,
Devlin 2017/01/26 22:47:39 See comment in extension_service.cc
nrpeter 2017/02/03 19:32:24 Done.
+ const URLPatternSet& runtime_blocked_hosts,
Devlin 2017/01/26 22:47:39 don't forget to use git cl format - it's a life-sa
nrpeter 2017/02/03 19:32:24 Done.
+ const URLPatternSet& runtime_allowed_hosts,
+ bool is_default);
+
+ // Sets list of hosts extensions may not interact with. Extension specific
+ // exceptions to this default policy are defined with
+ // SetPolicyHostRestrictions. This is the Deault scope "*" of
+ // ExtensionSettings.
+ void SetDefaultPolicyHostRestrictions(
+ const URLPatternSet& default_runtime_blocked_hosts,
+ const URLPatternSet& default_runtime_allowed_hosts);
+
// Returns the set of revokable permissions.
std::unique_ptr<const PermissionSet> GetRevokablePermissions(
const Extension* extension) const;
@@ -86,6 +103,7 @@ class PermissionsUpdater {
enum EventType {
ADDED,
REMOVED,
+ POLICY
Devlin 2017/01/26 22:47:39 nit: trailing comma
nrpeter 2017/02/03 19:32:24 Done.
};
// Sets the |extension|'s active permissions to |active| and records the
@@ -111,6 +129,14 @@ class PermissionsUpdater {
const Extension* extension,
const PermissionSet& changed);
+ // Issues the relevant events, messages and notifications when the
+ // default scope management policy have changed.
+ // Specifically, this sends the ExtensionMsg_UpdateDefaultHostRestrictions
+ // IPC message.
+ void NotifyDefaultPolicyHostRestrictionsUpdated(
+ const URLPatternSet& default_runtime_blocked_hosts,
+ const URLPatternSet& default_runtime_allowed_hosts);
+
// The associated BrowserContext.
content::BrowserContext* browser_context_;

Powered by Google App Engine
This is Rietveld 408576698