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

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: . 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 491a80aaeff2697e048d3baee461180b53c69832..a3b0002d756bc32bbe664d8ace749ca20e1b1b2c 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"
@@ -319,6 +320,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);
@@ -404,9 +409,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.
@@ -467,6 +472,10 @@ class ExtensionService
return &app_notification_manager_;
}
+ ExtensionPermissionsManager* permissions_manager() {
+ return &permissions_manager_;
+ }
+
ExtensionBrowserEventRouter* browser_event_router() {
return browser_event_router_.get();
}
@@ -579,7 +588,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);
@@ -701,6 +709,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_;

Powered by Google App Engine
This is Rietveld 408576698