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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.h

Issue 971733003: Supervised users: When an extension requires new permissions, send request to custodian (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_ext_install_disable
Patch Set: review Created 5 years, 10 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/supervised_user/supervised_user_service.h
diff --git a/chrome/browser/supervised_user/supervised_user_service.h b/chrome/browser/supervised_user/supervised_user_service.h
index e4b77e1de89a92c64434519143f72138a55b2856..42f9e0840487a101e7e554c8a3d0ef71b7433362 100644
--- a/chrome/browser/supervised_user/supervised_user_service.h
+++ b/chrome/browser/supervised_user/supervised_user_service.h
@@ -111,13 +111,16 @@ class SupervisedUserService : public KeyedService,
// Returns the whitelist service.
SupervisedUserWhitelistService* GetWhitelistService();
- // Whether the user can request access to blocked URLs.
+ // Whether the user can request to get access to blocked URLs or to new
+ // extensions.
bool AccessRequestsEnabled();
- // Adds an access request for the given URL. The requests are stored using
- // a prefix followed by a URIEncoded version of the URL. Each entry contains
- // a dictionary which currently has the timestamp of the request in it.
- void AddAccessRequest(const GURL& url, const SuccessCallback& callback);
+ // Adds an access request for the given URL.
+ void AddURLAccessRequest(const GURL& url, const SuccessCallback& callback);
+
+ // Adds an update request for the given WebStore item (App/Extension).
+ void AddExtensionUpdateRequest(const std::string& extension_id,
+ const SuccessCallback& callback);
// Returns the email address of the custodian.
std::string GetCustodianEmailAddress() const;
@@ -229,6 +232,11 @@ class SupervisedUserService : public KeyedService,
DISALLOW_COPY_AND_ASSIGN(URLFilterContext);
};
+ // Helper classes to send different kinds of permission requests.
+ class SendPermissionRequestHelper;
+ class SendURLAccessRequestHelper;
+ class SendExtensionUpdateRequestHelper;
+
// Use |SupervisedUserServiceFactory::GetForProfile(..)| to get
// an instance of this service.
explicit SupervisedUserService(Profile* profile);
@@ -266,13 +274,15 @@ class SupervisedUserService : public KeyedService,
SupervisedUserSettingsService* GetSettingsService();
size_t FindEnabledPermissionRequestCreator(size_t start);
- void AddAccessRequestInternal(const GURL& url,
- const SuccessCallback& callback,
- size_t index);
- void OnPermissionRequestIssued(const GURL& url,
- const SuccessCallback& callback,
- size_t index,
- bool success);
+ void AddPermissionRequestInternal(
+ scoped_ptr<SendPermissionRequestHelper> helper,
+ const SuccessCallback& callback,
+ size_t index);
+ void OnPermissionRequestIssued(
+ scoped_ptr<SendPermissionRequestHelper> helper,
+ const SuccessCallback& callback,
+ size_t index,
+ bool success);
void OnSupervisedUserIdChanged();

Powered by Google App Engine
This is Rietveld 408576698