diff options
author | jstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-29 00:45:34 +0000 |
---|---|---|
committer | jstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-29 00:45:34 +0000 |
commit | c09e2d208da071a7fdb7d53c7f0bdea4e0aa2fd8 (patch) | |
tree | 4c24a67380cbaf52b4dfa90e17189ccec01dbc66 /chrome/browser/extensions/extension_prefs.h | |
parent | fdf6801902413c5662d071fba731e013e04f5181 (diff) | |
download | chromium_src-c09e2d208da071a7fdb7d53c7f0bdea4e0aa2fd8.zip chromium_src-c09e2d208da071a7fdb7d53c7f0bdea4e0aa2fd8.tar.gz chromium_src-c09e2d208da071a7fdb7d53c7f0bdea4e0aa2fd8.tar.bz2 |
Revert 67500 - Adds a section to the extension preferences to store the recognized permissions that the user has granted the extension.
Ignores unknown permissions when installing extensions.
Disables extension and prompts user to re-enable when unknown permissions become recognized (e.g., through browser upgrade).
Allows extensions to remove a permission in one version, then add them back in the next without prompting the user.
BUG=42742
TEST=ExtensionsServiceTest, ExtensionPrefsGrantedPermissions, ExtensionTest
Review URL: http://codereview.chromium.org/4687005
TBR=jstritar@chromium.org
Review URL: http://codereview.chromium.org/5286009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs.h')
-rw-r--r-- | chrome/browser/extensions/extension_prefs.h | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index 26e4327..0bcd9f9 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -123,27 +123,6 @@ class ExtensionPrefs { // the client's. void SetLastPingDay(const std::string& extension_id, const base::Time& time); - // 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): Refractor 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, - ExtensionExtent* 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). - void AddGrantedPermissions(const std::string& extension_id, - const bool full_access, - const std::set<std::string>& api_permissions, - const ExtensionExtent& host_extent); - // Similar to the 2 above, but for the extensions blacklist. base::Time BlacklistLastPingDay() const; void SetBlacklistLastPingDay(const base::Time& time); @@ -243,7 +222,7 @@ class ExtensionPrefs { void DeleteExtensionPrefs(const std::string& id); // Reads a boolean pref from |ext| with key |pref_key|. - // Return false if the value is false or |pref_key| does not exist. + // Return false if the value is false or kPrefBlacklist does not exist. bool ReadBooleanFromPref(DictionaryValue* ext, const std::string& pref_key); // Reads a boolean pref |pref_key| from extension with id |extension_id|. @@ -260,24 +239,6 @@ class ExtensionPrefs { const std::string& pref_key, int* out_value); - // Reads a list pref |pref_key| from extension with id | extension_id|. - bool ReadExtensionPrefList(const std::string& extension_id, - const std::string& pref_key, - ListValue** out_value); - - // Reads a list pref |pref_key| as a string set from the extension with - // id |extension_id|. - bool ReadExtensionPrefStringSet(const std::string& extension_id, - const std::string& pref_key, - std::set<std::string>* result); - - // 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); - // Ensures and returns a mutable dictionary for extension |id|'s prefs. DictionaryValue* GetOrCreateExtensionPref(const std::string& id); |