OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_MANAGEMENT_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_MANAGEMENT_POLICY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_MANAGEMENT_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_MANAGEMENT_POLICY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 28 matching lines...) Expand all Loading... |
39 // | 39 // |
40 // For all of the Provider methods below, if |error| is not NULL and the | 40 // For all of the Provider methods below, if |error| is not NULL and the |
41 // method imposes a restriction on the desired action, |error| may be set | 41 // method imposes a restriction on the desired action, |error| may be set |
42 // to an applicable error message, but this is not required. | 42 // to an applicable error message, but this is not required. |
43 class Provider { | 43 class Provider { |
44 public: | 44 public: |
45 Provider() {} | 45 Provider() {} |
46 virtual ~Provider() {} | 46 virtual ~Provider() {} |
47 | 47 |
48 // A human-readable name for this provider, for use in debug messages. | 48 // A human-readable name for this provider, for use in debug messages. |
49 virtual std::string GetPolicyProviderName() const = 0; | 49 // Implementers should return an empty string in non-debug builds, to save |
| 50 // executable size. |
| 51 virtual std::string GetDebugPolicyProviderName() const = 0; |
50 | 52 |
51 // Providers should return false if a user may not install the |extension|, | 53 // Providers should return false if a user may not install the |extension|, |
52 // or load or run it if it has already been installed. | 54 // or load or run it if it has already been installed. |
53 virtual bool UserMayLoad(const Extension* extension, | 55 virtual bool UserMayLoad(const Extension* extension, |
54 string16* error) const; | 56 string16* error) const; |
55 | 57 |
56 // Providers should return false if a user may not enable, disable, or | 58 // Providers should return false if a user may not enable, disable, or |
57 // uninstall the |extension|, or change its usage options (incognito | 59 // uninstall the |extension|, or change its usage options (incognito |
58 // permission, file access, etc.). | 60 // permission, file access, etc.). |
59 virtual bool UserMayModifySettings(const Extension* extension, | 61 virtual bool UserMayModifySettings(const Extension* extension, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 private: | 105 private: |
104 typedef std::set<Provider*> ProviderList; | 106 typedef std::set<Provider*> ProviderList; |
105 ProviderList providers_; | 107 ProviderList providers_; |
106 | 108 |
107 DISALLOW_COPY_AND_ASSIGN(ManagementPolicy); | 109 DISALLOW_COPY_AND_ASSIGN(ManagementPolicy); |
108 }; | 110 }; |
109 | 111 |
110 } // namespace | 112 } // namespace |
111 | 113 |
112 #endif // CHROME_BROWSER_EXTENSIONS_MANAGEMENT_POLICY_H_ | 114 #endif // CHROME_BROWSER_EXTENSIONS_MANAGEMENT_POLICY_H_ |
OLD | NEW |