Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // (in SupervisedUserResourceThrottle). | 104 // (in SupervisedUserResourceThrottle). |
| 105 scoped_refptr<const SupervisedUserURLFilter> GetURLFilterForIOThread(); | 105 scoped_refptr<const SupervisedUserURLFilter> GetURLFilterForIOThread(); |
| 106 | 106 |
| 107 // Returns the URL filter for the UI thread, for filtering navigations and | 107 // Returns the URL filter for the UI thread, for filtering navigations and |
| 108 // classifying sites in the history view. | 108 // classifying sites in the history view. |
| 109 SupervisedUserURLFilter* GetURLFilterForUIThread(); | 109 SupervisedUserURLFilter* GetURLFilterForUIThread(); |
| 110 | 110 |
| 111 // Returns the whitelist service. | 111 // Returns the whitelist service. |
| 112 SupervisedUserWhitelistService* GetWhitelistService(); | 112 SupervisedUserWhitelistService* GetWhitelistService(); |
| 113 | 113 |
| 114 // Whether the user can request access to blocked URLs. | 114 // Whether the user can request to get access to blocked URLs or to new |
| 115 // extensions. | |
| 115 bool AccessRequestsEnabled(); | 116 bool AccessRequestsEnabled(); |
| 116 | 117 |
| 117 // Adds an access request for the given URL. The requests are stored using | 118 // Adds an access request for the given URL. |
| 118 // a prefix followed by a URIEncoded version of the URL. Each entry contains | 119 void AddURLAccessRequest(const GURL& url, const SuccessCallback& callback); |
| 119 // a dictionary which currently has the timestamp of the request in it. | 120 |
| 120 void AddAccessRequest(const GURL& url, const SuccessCallback& callback); | 121 // Adds an update request for the given WebStore item (App/Extension). |
| 122 void AddExtensionUpdateRequest(const std::string& extension_id, | |
| 123 const SuccessCallback& callback); | |
| 121 | 124 |
| 122 // Returns the email address of the custodian. | 125 // Returns the email address of the custodian. |
| 123 std::string GetCustodianEmailAddress() const; | 126 std::string GetCustodianEmailAddress() const; |
| 124 | 127 |
| 125 // Returns the name of the custodian, or the email address if the name is | 128 // Returns the name of the custodian, or the email address if the name is |
| 126 // empty. | 129 // empty. |
| 127 std::string GetCustodianName() const; | 130 std::string GetCustodianName() const; |
| 128 | 131 |
| 129 // Returns the email address of the second custodian, or the empty string | 132 // Returns the email address of the second custodian, or the empty string |
| 130 // if there is no second custodian. | 133 // if there is no second custodian. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 friend class SupervisedUserServiceFactory; | 182 friend class SupervisedUserServiceFactory; |
| 180 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity); | 183 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity); |
| 181 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); | 184 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); |
| 182 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, | 185 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
| 183 ChangesIncludedSessionOnChangedSettings); | 186 ChangesIncludedSessionOnChangedSettings); |
| 184 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, | 187 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
| 185 ChangesSyncSessionStateOnChangedSettings); | 188 ChangesSyncSessionStateOnChangedSettings); |
| 186 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceExtensionTest, | 189 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceExtensionTest, |
| 187 ExtensionManagementPolicyProvider); | 190 ExtensionManagementPolicyProvider); |
| 188 | 191 |
| 192 typedef base::Callback<void(PermissionRequestCreator*, | |
|
Bernhard Bauer
2015/03/03 11:14:01
Optional: you could use `using` instead of typedef
Marc Treib
2015/03/03 11:32:20
Done. I've also updated the existing typedefs to u
| |
| 193 const SuccessCallback&)> | |
| 194 CreatePermissionRequestCallback; | |
| 195 | |
| 189 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which | 196 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which |
| 190 // lives on the IO thread. This class mediates access to them and makes sure | 197 // lives on the IO thread. This class mediates access to them and makes sure |
| 191 // they are kept in sync. | 198 // they are kept in sync. |
| 192 class URLFilterContext { | 199 class URLFilterContext { |
| 193 public: | 200 public: |
| 194 URLFilterContext(); | 201 URLFilterContext(); |
| 195 ~URLFilterContext(); | 202 ~URLFilterContext(); |
| 196 | 203 |
| 197 SupervisedUserURLFilter* ui_url_filter() const; | 204 SupervisedUserURLFilter* ui_url_filter() const; |
| 198 SupervisedUserURLFilter* io_url_filter() const; | 205 SupervisedUserURLFilter* io_url_filter() const; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 bool MustRemainInstalled(const extensions::Extension* extension, | 266 bool MustRemainInstalled(const extensions::Extension* extension, |
| 260 base::string16* error) const override; | 267 base::string16* error) const override; |
| 261 | 268 |
| 262 // Extensions helper to SetActive(). | 269 // Extensions helper to SetActive(). |
| 263 void SetExtensionsActive(); | 270 void SetExtensionsActive(); |
| 264 #endif | 271 #endif |
| 265 | 272 |
| 266 SupervisedUserSettingsService* GetSettingsService(); | 273 SupervisedUserSettingsService* GetSettingsService(); |
| 267 | 274 |
| 268 size_t FindEnabledPermissionRequestCreator(size_t start); | 275 size_t FindEnabledPermissionRequestCreator(size_t start); |
| 269 void AddAccessRequestInternal(const GURL& url, | 276 void AddPermissionRequestInternal( |
| 270 const SuccessCallback& callback, | 277 const CreatePermissionRequestCallback& create_request, |
| 271 size_t index); | 278 const SuccessCallback& callback, |
| 272 void OnPermissionRequestIssued(const GURL& url, | 279 size_t index); |
| 273 const SuccessCallback& callback, | 280 void OnPermissionRequestIssued( |
| 274 size_t index, | 281 const CreatePermissionRequestCallback& create_request, |
| 275 bool success); | 282 const SuccessCallback& callback, |
| 283 size_t index, | |
| 284 bool success); | |
| 276 | 285 |
| 277 void OnSupervisedUserIdChanged(); | 286 void OnSupervisedUserIdChanged(); |
| 278 | 287 |
| 279 void OnDefaultFilteringBehaviorChanged(); | 288 void OnDefaultFilteringBehaviorChanged(); |
| 280 | 289 |
| 281 void OnSiteListsChanged( | 290 void OnSiteListsChanged( |
| 282 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists); | 291 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists); |
| 283 | 292 |
| 284 // Asynchronously downloads a static blacklist file from |url|, stores it at | 293 // Asynchronously downloads a static blacklist file from |url|, stores it at |
| 285 // |path|, loads it, and applies it to the URL filters. If |url| is not valid | 294 // |path|, loads it, and applies it to the URL filters. If |url| is not valid |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 | 355 |
| 347 // Used to create permission requests. | 356 // Used to create permission requests. |
| 348 ScopedVector<PermissionRequestCreator> permissions_creators_; | 357 ScopedVector<PermissionRequestCreator> permissions_creators_; |
| 349 | 358 |
| 350 ObserverList<SupervisedUserServiceObserver> observer_list_; | 359 ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 351 | 360 |
| 352 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 361 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 353 }; | 362 }; |
| 354 | 363 |
| 355 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 364 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |