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 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "extensions/common/extension.h" | 13 #include "extensions/common/extension.h" |
13 | 14 |
14 namespace extensions { | 15 namespace extensions { |
15 | 16 |
16 // This class registers providers that want to prohibit certain actions from | 17 // This class registers providers that want to prohibit certain actions from |
17 // being applied to extensions. It must be called, via the ExtensionService, | 18 // being applied to extensions. It must be called, via the ExtensionService, |
18 // before allowing a user or a user-level mechanism to perform the respective | 19 // before allowing a user or a user-level mechanism to perform the respective |
19 // action. (That is, installing or otherwise modifying an extension in order | 20 // action. (That is, installing or otherwise modifying an extension in order |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 86 |
86 ManagementPolicy(); | 87 ManagementPolicy(); |
87 ~ManagementPolicy(); | 88 ~ManagementPolicy(); |
88 | 89 |
89 // Registers or unregisters a provider, causing it to be added to or removed | 90 // Registers or unregisters a provider, causing it to be added to or removed |
90 // from the list of providers queried. Ownership of the provider remains with | 91 // from the list of providers queried. Ownership of the provider remains with |
91 // the caller. Providers do not need to be unregistered on shutdown. | 92 // the caller. Providers do not need to be unregistered on shutdown. |
92 void RegisterProvider(Provider* provider); | 93 void RegisterProvider(Provider* provider); |
93 void UnregisterProvider(Provider* provider); | 94 void UnregisterProvider(Provider* provider); |
94 | 95 |
| 96 // Like RegisterProvider(), but registers multiple providers instead. |
| 97 void RegisterProviders(std::vector<Provider*> providers); |
| 98 |
95 // Returns true if the user is permitted to install, load, and run the given | 99 // Returns true if the user is permitted to install, load, and run the given |
96 // extension. If not, |error| may be set to an appropriate message. | 100 // extension. If not, |error| may be set to an appropriate message. |
97 bool UserMayLoad(const Extension* extension, base::string16* error) const; | 101 bool UserMayLoad(const Extension* extension, base::string16* error) const; |
98 | 102 |
99 // Returns true if the user is permitted to enable, disable, or uninstall the | 103 // Returns true if the user is permitted to enable, disable, or uninstall the |
100 // given extension, or change the extension's usage options (incognito mode, | 104 // given extension, or change the extension's usage options (incognito mode, |
101 // file access, etc.). If not, |error| may be set to an appropriate message. | 105 // file access, etc.). If not, |error| may be set to an appropriate message. |
102 bool UserMayModifySettings(const Extension* extension, | 106 bool UserMayModifySettings(const Extension* extension, |
103 base::string16* error) const; | 107 base::string16* error) const; |
104 | 108 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 base::string16* error) const; | 147 base::string16* error) const; |
144 | 148 |
145 ProviderList providers_; | 149 ProviderList providers_; |
146 | 150 |
147 DISALLOW_COPY_AND_ASSIGN(ManagementPolicy); | 151 DISALLOW_COPY_AND_ASSIGN(ManagementPolicy); |
148 }; | 152 }; |
149 | 153 |
150 } // namespace extensions | 154 } // namespace extensions |
151 | 155 |
152 #endif // EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ | 156 #endif // EXTENSIONS_BROWSER_MANAGEMENT_POLICY_H_ |
OLD | NEW |