Chromium Code Reviews| 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..a9226f83aaf1eb694429dd1611d3afc2cde1ab1b 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); |
| + // Updates the |extension|'s active permission set to include only permissions |
| + // currently requested by the extension and all the permissions required by |
| + // the extension. |
| + void UpdateActivePermissions(const Extension* extension); |
|
Yoyo Zhou
2014/06/20 16:13:39
This only gets called in the flow from AddPermissi
Devlin
2014/06/20 17:05:29
Done.
(I assume you meant "called in the flow fro
|
| 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 |