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

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

Issue 7003098: Start refractoring extension permissions into ExtensionPermissionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a bad merge Created 9 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
Index: chrome/browser/extensions/extension_prefs.h
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index 2ea50e45cc64320c7947abe8166b822c113925ab..affa57887ed7e74eb9099eeea57b77a786feb722 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -173,26 +173,19 @@ class ExtensionPrefs : public ExtensionContentSettingsStore::Observer {
bool GetActiveBit(const std::string& extension_id);
void SetActiveBit(const std::string& extension_id, bool active);
- // Gets the permissions (|api_permissions|, |host_extent| and |full_access|)
- // granted to the extension with |extension_id|. |full_access| will be true
- // if the extension has all effective permissions (like from an NPAPI plugin).
- // Returns false if the granted permissions haven't been initialized yet.
- // TODO(jstritar): Refactor the permissions into a class that encapsulates
- // all granted permissions, can be initialized from preferences or
- // a manifest file, and can be compared to each other.
- bool GetGrantedPermissions(const std::string& extension_id,
- bool* full_access,
- std::set<std::string>* api_permissions,
- URLPatternSet* host_extent);
-
- // Adds the specified |api_permissions|, |host_extent| and |full_access|
- // to the granted permissions for extension with |extension_id|.
- // |full_access| should be set to true if the extension effectively has all
- // permissions (such as by having an NPAPI plugin).
+ // Returns the granted permission set for the extension with |extension_id|.
+ // This sets |initialized| to true (when not NULL) if the extension's granted
+ // permissions have been initialized (to help distinguish between empty
+ // permission sets and new extensions).
+ // This passes ownership of the returned set to the caller.
+ ExtensionPermissionSet* GetGrantedPermissions(
+ const std::string& extension_id, bool* initialized);
+
+ // Adds the |permissions| to the granted permissions set for the extension
+ // with |extension_id|. The new granted permissions set will be the union
+ // of the already granted permissions and |permissions|.
void AddGrantedPermissions(const std::string& extension_id,
- const bool full_access,
- const std::set<std::string>& api_permissions,
- const URLPatternSet& host_extent);
+ const ExtensionPermissionSet& permissions);
// Returns true if the user enabled this extension to be loaded in incognito
// mode.
@@ -407,9 +400,9 @@ class ExtensionPrefs : public ExtensionContentSettingsStore::Observer {
// Adds the |added_values| to the value of |pref_key| for the extension
// with id |extension_id| (the new value will be the union of the existing
// value and |added_values|).
- void AddToExtensionPrefStringSet(const std::string& extension_id,
- const std::string& pref_key,
- const std::set<std::string>& added_values);
+ void SetExtensionPrefStringSet(const std::string& extension_id,
+ const std::string& pref_key,
+ const std::set<std::string>& added_values);
// Returns a dictionary for extension |id|'s prefs or NULL if it doesn't
// exist.

Powered by Google App Engine
This is Rietveld 408576698