| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 #if defined(ENABLE_EXTENSIONS) | 295 #if defined(ENABLE_EXTENSIONS) |
| 296 // extensions::ManagementPolicy::Provider implementation: | 296 // extensions::ManagementPolicy::Provider implementation: |
| 297 std::string GetDebugPolicyProviderName() const override; | 297 std::string GetDebugPolicyProviderName() const override; |
| 298 bool UserMayLoad(const extensions::Extension* extension, | 298 bool UserMayLoad(const extensions::Extension* extension, |
| 299 base::string16* error) const override; | 299 base::string16* error) const override; |
| 300 bool UserMayModifySettings(const extensions::Extension* extension, | 300 bool UserMayModifySettings(const extensions::Extension* extension, |
| 301 base::string16* error) const override; | 301 base::string16* error) const override; |
| 302 bool MustRemainInstalled(const extensions::Extension* extension, | 302 bool MustRemainInstalled(const extensions::Extension* extension, |
| 303 base::string16* error) const override; | 303 base::string16* error) const override; |
| 304 | 304 |
| 305 // An extension can be in one of the following states: |
| 306 // |
| 307 // FORCED: if it is installed by the custodian. |
| 308 // ALLOWED: Components, Themes, Default extensions ..etc |
| 309 // are generally allowed. Extensions that have been approved by the |
| 310 // custodian are also allowed. |
| 311 // BLOCKED: if it is not ALLOWED or FORCED |
| 312 // and supervised users initiated installs are disabled. |
| 313 enum ExtensionState { |
| 314 EXTENSION_FORCED, |
| 315 EXTENSION_BLOCKED, |
| 316 EXTENSION_ALLOWED |
| 317 }; |
| 318 |
| 319 // Returns the state of an extension whether being FORCED, BLOCK, or ALLOWED |
| 320 // from the Supervised User service's point of view. |
| 321 ExtensionState GetExtensionState( |
| 322 const extensions::Extension* extension) const; |
| 323 |
| 305 // Extensions helper to SetActive(). | 324 // Extensions helper to SetActive(). |
| 306 void SetExtensionsActive(); | 325 void SetExtensionsActive(); |
| 307 #endif | 326 #endif |
| 308 | 327 |
| 309 SupervisedUserSettingsService* GetSettingsService(); | 328 SupervisedUserSettingsService* GetSettingsService(); |
| 310 | 329 |
| 311 size_t FindEnabledPermissionRequestCreator(size_t start); | 330 size_t FindEnabledPermissionRequestCreator(size_t start); |
| 312 void AddPermissionRequestInternal( | 331 void AddPermissionRequestInternal( |
| 313 const CreatePermissionRequestCallback& create_request, | 332 const CreatePermissionRequestCallback& create_request, |
| 314 const SuccessCallback& callback, | 333 const SuccessCallback& callback, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 432 |
| 414 base::ObserverList<SupervisedUserServiceObserver> observer_list_; | 433 base::ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 415 | 434 |
| 416 // Prevents Sync from running until configuration is complete. | 435 // Prevents Sync from running until configuration is complete. |
| 417 std::unique_ptr<sync_driver::SyncSetupInProgressHandle> sync_blocker_; | 436 std::unique_ptr<sync_driver::SyncSetupInProgressHandle> sync_blocker_; |
| 418 | 437 |
| 419 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 438 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 420 }; | 439 }; |
| 421 | 440 |
| 422 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 441 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |