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

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

Issue 7432006: Add an experimental permissions API for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang Created 9 years, 5 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_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 4c74f0a80f3c4de177542075f0f954836a75654b..901726fe3338c027643c2a44e79cce92baebd9e7 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -26,6 +26,7 @@
#include "chrome/browser/extensions/extension_icon_manager.h"
#include "chrome/browser/extensions/extension_menu_manager.h"
#include "chrome/browser/extensions/extension_prefs.h"
+#include "chrome/browser/extensions/extension_permissions_api.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/extensions/extensions_quota_service.h"
@@ -320,6 +321,10 @@ class ExtensionService
// extension.
void GrantPermissionsAndEnableExtension(const Extension* extension);
+ // Sets the |extension|'s active permissions to |permissions|.
+ void UpdateActivePermissions(const Extension* extension,
+ const ExtensionPermissionSet* permissions);
+
// Loads the extension from the directory |extension_path|.
void LoadExtension(const FilePath& extension_path);
@@ -405,9 +410,9 @@ class ExtensionService
void OnExtensionInstalled(
const Extension* extension, bool from_webstore);
- // 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);
+ // Initializes the |extension|'s active permission set and disables the
+ // extension if the privilege level has increased (e.g., due to an upgrade).
+ void InitializePermissions(const Extension* extension);
// Go through each extensions in pref, unload blacklisted extensions
// and update the blacklist state in pref.
@@ -468,6 +473,10 @@ class ExtensionService
return &app_notification_manager_;
}
+ ExtensionPermissionsManager* permissions_manager() {
+ return &permissions_manager_;
+ }
+
ExtensionBrowserEventRouter* browser_event_router() {
return browser_event_router_.get();
}
@@ -586,7 +595,6 @@ class ExtensionService
bool include_disabled,
bool include_terminated) const;
-
// Adds the given extension to the list of terminated extensions if
// it is not already there and unloads it.
void TrackTerminatedExtension(const Extension* extension);
@@ -708,6 +716,9 @@ class ExtensionService
// Keeps track of app notifications.
AppNotificationManager app_notification_manager_;
+ // Keeps track of extension permissions.
+ ExtensionPermissionsManager permissions_manager_;
+
// Keeps track of favicon-sized omnibox icons for extensions.
ExtensionIconManager omnibox_icon_manager_;
ExtensionIconManager omnibox_popup_icon_manager_;
« no previous file with comments | « chrome/browser/extensions/extension_prefs_unittest.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698