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

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

Issue 347803005: Move UpdateActivePermissions from ExtensionService to PermissionsUpdater (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/UpdateActivePermissions/InitializeActivePermissions Created 6 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
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/permissions_updater.h
diff --git a/chrome/browser/extensions/permissions_updater.h b/chrome/browser/extensions/permissions_updater.h
index bbd7200a77301270d9e4f18aef8f0b105913e61b..073dd10ff271c49f6018cc19df0952608596f09b 100644
--- a/chrome/browser/extensions/permissions_updater.h
+++ b/chrome/browser/extensions/permissions_updater.h
@@ -9,12 +9,14 @@
#include "base/memory/ref_counted.h"
-class Profile;
-
namespace base {
class DictionaryValue;
}
+namespace content {
+class BrowserContext;
+}
+
namespace extensions {
class Extension;
@@ -25,7 +27,7 @@ class PermissionSet;
// and notifies interested parties of the changes.
class PermissionsUpdater {
public:
- explicit PermissionsUpdater(Profile* profile);
+ explicit PermissionsUpdater(content::BrowserContext* browser_context);
~PermissionsUpdater();
// Adds the set of |permissions| to the |extension|'s active permission set
@@ -43,9 +45,10 @@ class PermissionsUpdater {
// granted permission set.
void GrantActivePermissions(const Extension* extension);
- // Sets the |extension|'s active permissions to |permissions|.
- void UpdateActivePermissions(const Extension* extension,
- const PermissionSet* permissions);
+ // Initializes the |extension|'s active permission set to include only
+ // permissions currently requested by the extension and all the permissions
+ // required by the extension.
+ void InitializeActivePermissions(const Extension* extension);
private:
enum EventType {
@@ -53,6 +56,11 @@ class PermissionsUpdater {
REMOVED,
};
+ // Sets the |extension|'s active permissions to |permissions| and records the
+ // change in the prefs.
+ void SetActivePermissions(const Extension* extension,
+ const PermissionSet* permisssions);
+
// Dispatches specified event to the extension.
void DispatchEvent(const std::string& extension_id,
const char* event_name,
@@ -67,10 +75,8 @@ class PermissionsUpdater {
const Extension* extension,
const PermissionSet* changed);
- // Gets the ExtensionPrefs for the associated profile.
- ExtensionPrefs* GetExtensionPrefs();
-
- Profile* profile_;
+ // The associated BrowserContext.
+ content::BrowserContext* browser_context_;
};
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698