| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 bool MustRemainInstalled(const extensions::Extension* extension, | 262 bool MustRemainInstalled(const extensions::Extension* extension, |
| 260 base::string16* error) const override; | 263 base::string16* error) const override; |
| 261 | 264 |
| 262 // Extensions helper to SetActive(). | 265 // Extensions helper to SetActive(). |
| 263 void SetExtensionsActive(); | 266 void SetExtensionsActive(); |
| 264 #endif | 267 #endif |
| 265 | 268 |
| 266 SupervisedUserSettingsService* GetSettingsService(); | 269 SupervisedUserSettingsService* GetSettingsService(); |
| 267 | 270 |
| 268 size_t FindEnabledPermissionRequestCreator(size_t start); | 271 size_t FindEnabledPermissionRequestCreator(size_t start); |
| 269 void AddAccessRequestInternal(const GURL& url, | 272 void AddURLAccessRequestInternal(const GURL& url, |
| 273 const SuccessCallback& callback, |
| 274 size_t index); |
| 275 void OnURLAccessRequestIssued(const GURL& url, |
| 270 const SuccessCallback& callback, | 276 const SuccessCallback& callback, |
| 271 size_t index); | 277 size_t index, |
| 272 void OnPermissionRequestIssued(const GURL& url, | 278 bool success); |
| 273 const SuccessCallback& callback, | 279 void AddExtensionUpdateRequestInternal(const std::string& extension_id, |
| 274 size_t index, | 280 const SuccessCallback& callback, |
| 275 bool success); | 281 size_t index); |
| 282 void OnExtensionUpdateRequestIssued(const std::string& extension_id, |
| 283 const SuccessCallback& callback, |
| 284 size_t index, |
| 285 bool success); |
| 276 | 286 |
| 277 void OnSupervisedUserIdChanged(); | 287 void OnSupervisedUserIdChanged(); |
| 278 | 288 |
| 279 void OnDefaultFilteringBehaviorChanged(); | 289 void OnDefaultFilteringBehaviorChanged(); |
| 280 | 290 |
| 281 void OnSiteListsChanged( | 291 void OnSiteListsChanged( |
| 282 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists); | 292 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists); |
| 283 | 293 |
| 284 // Asynchronously downloads a static blacklist file from |url|, stores it at | 294 // 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 | 295 // |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 | 356 |
| 347 // Used to create permission requests. | 357 // Used to create permission requests. |
| 348 ScopedVector<PermissionRequestCreator> permissions_creators_; | 358 ScopedVector<PermissionRequestCreator> permissions_creators_; |
| 349 | 359 |
| 350 ObserverList<SupervisedUserServiceObserver> observer_list_; | 360 ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 351 | 361 |
| 352 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 362 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 353 }; | 363 }; |
| 354 | 364 |
| 355 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 365 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |