| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ | 5 #ifndef EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ |
| 6 #define EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ | 6 #define EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ManagementPolicy(); | 93 ManagementPolicy(); |
| 94 ~ManagementPolicy(); | 94 ~ManagementPolicy(); |
| 95 | 95 |
| 96 // Registers or unregisters a provider, causing it to be added to or removed | 96 // Registers or unregisters a provider, causing it to be added to or removed |
| 97 // from the list of providers queried. Ownership of the provider remains with | 97 // from the list of providers queried. Ownership of the provider remains with |
| 98 // the caller. Providers do not need to be unregistered on shutdown. | 98 // the caller. Providers do not need to be unregistered on shutdown. |
| 99 void RegisterProvider(Provider* provider); | 99 void RegisterProvider(Provider* provider); |
| 100 void UnregisterProvider(Provider* provider); | 100 void UnregisterProvider(Provider* provider); |
| 101 | 101 |
| 102 // Like RegisterProvider(), but registers multiple providers instead. | 102 // Like RegisterProvider(), but registers multiple providers instead. |
| 103 void RegisterProviders(std::vector<Provider*> providers); | 103 void RegisterProviders( |
| 104 const std::vector<std::unique_ptr<Provider>>& providers); |
| 104 | 105 |
| 105 // Returns true if the user is permitted to install, load, and run the given | 106 // Returns true if the user is permitted to install, load, and run the given |
| 106 // extension. If not, |error| may be set to an appropriate message. | 107 // extension. If not, |error| may be set to an appropriate message. |
| 107 // TODO(treib,pam): Misleading name; see comment in Provider. crbug.com/461747 | 108 // TODO(treib,pam): Misleading name; see comment in Provider. crbug.com/461747 |
| 108 bool UserMayLoad(const Extension* extension, base::string16* error) const; | 109 bool UserMayLoad(const Extension* extension, base::string16* error) const; |
| 109 | 110 |
| 110 // Returns true if the user is permitted to enable, disable, or uninstall the | 111 // Returns true if the user is permitted to enable, disable, or uninstall the |
| 111 // given extension, or change the extension's usage options (incognito mode, | 112 // given extension, or change the extension's usage options (incognito mode, |
| 112 // file access, etc.). If not, |error| may be set to an appropriate message. | 113 // file access, etc.). If not, |error| may be set to an appropriate message. |
| 113 // TODO(treib,pam): Misleading name; see comment in Provider. crbug.com/461747 | 114 // TODO(treib,pam): Misleading name; see comment in Provider. crbug.com/461747 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 base::string16* error) const; | 156 base::string16* error) const; |
| 156 | 157 |
| 157 ProviderList providers_; | 158 ProviderList providers_; |
| 158 | 159 |
| 159 DISALLOW_COPY_AND_ASSIGN(ManagementPolicy); | 160 DISALLOW_COPY_AND_ASSIGN(ManagementPolicy); |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 } // namespace extensions | 163 } // namespace extensions |
| 163 | 164 |
| 164 #endif // EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ | 165 #endif // EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ |
| OLD | NEW |