summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_service.h
diff options
context:
space:
mode:
authorjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 00:00:25 +0000
committerjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 00:00:25 +0000
commit8d888c1f500baf0b51085803e5b7a2d80caf3f00 (patch)
tree9a9763f054d606fd37a13363c69fa42f2ab4bd3a /chrome/browser/extensions/extensions_service.h
parent4376ec3d152063896078cae661f72a9b2345d35b (diff)
downloadchromium_src-8d888c1f500baf0b51085803e5b7a2d80caf3f00.zip
chromium_src-8d888c1f500baf0b51085803e5b7a2d80caf3f00.tar.gz
chromium_src-8d888c1f500baf0b51085803e5b7a2d80caf3f00.tar.bz2
Track permissions granted to extensions in prefs
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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67500 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67544 Review URL: http://codereview.chromium.org/4687005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service.h')
-rw-r--r--chrome/browser/extensions/extensions_service.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index f19bb22..c831039 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -277,6 +277,15 @@ class ExtensionsService
void EnableExtension(const std::string& extension_id);
void DisableExtension(const std::string& extension_id);
+ // Updates the |extension|'s granted permissions lists to include all
+ // permissions in the |extension|'s manifest.
+ void GrantPermissions(const Extension* extension);
+
+ // Updates the |extension|'s granted permissions lists to include all
+ // permissions in the |extension|'s manifest and re-enables the
+ // extension.
+ void GrantPermissionsAndEnableExtension(const Extension* extension);
+
// Load the extension from the directory |extension_path|.
void LoadExtension(const FilePath& extension_path);
@@ -351,12 +360,10 @@ class ExtensionsService
virtual void OnLoadedInstalledExtensions();
// Called when an extension has been loaded.
- void OnExtensionLoaded(const Extension* extension,
- bool allow_privilege_increase);
+ void OnExtensionLoaded(const Extension* extension);
// Called by the backend when an extension has been installed.
- void OnExtensionInstalled(const Extension* extension,
- bool allow_privilege_increase);
+ void OnExtensionInstalled(const Extension* extension);
// Called by the backend when an external extension is found.
void OnExternalExtensionFileFound(const std::string& id,
@@ -364,6 +371,10 @@ class ExtensionsService
const FilePath& path,
Extension::Location location);
+ // Checks if the privileges requested by |extension| have increased, and if
+ // so, disables the extension and prompts the user to approve the change.
+ void DisableIfPrivilegeIncrease(const Extension* extension);
+
// Go through each extensions in pref, unload blacklisted extensions
// and update the blacklist state in pref.
virtual void UpdateExtensionBlacklist(