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_EXTENSIONS_EXTENSION_MANAGEMENT_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_TEST_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Helper functions for 'blocked_permissions' manipulation. |prefix| can be | 55 // Helper functions for 'blocked_permissions' manipulation. |prefix| can be |
56 // kWildCard or a valid extension ID. | 56 // kWildCard or a valid extension ID. |
57 void UnsetBlockedPermissions(const std::string& prefix); | 57 void UnsetBlockedPermissions(const std::string& prefix); |
58 void ClearBlockedPermissions(const std::string& prefix); | 58 void ClearBlockedPermissions(const std::string& prefix); |
59 void AddBlockedPermission(const std::string& prefix, | 59 void AddBlockedPermission(const std::string& prefix, |
60 const std::string& permission); | 60 const std::string& permission); |
61 void RemoveBlockedPermission(const std::string& prefix, | 61 void RemoveBlockedPermission(const std::string& prefix, |
62 const std::string& permission); | 62 const std::string& permission); |
63 | 63 |
64 // Helper functions for 'allowed_permissions' manipulation. |id| must be a | 64 // Helper functions for 'allowed_permissions' manipulation. |id| must be a |
65 // valid extension id. | 65 // valid extension ID. |
66 void UnsetAllowedPermissions(const std::string& id); | 66 void UnsetAllowedPermissions(const std::string& id); |
67 void ClearAllowedPermissions(const std::string& id); | 67 void ClearAllowedPermissions(const std::string& id); |
68 void AddAllowedPermission(const std::string& id, | 68 void AddAllowedPermission(const std::string& id, |
69 const std::string& permission); | 69 const std::string& permission); |
70 void RemoveAllowedPermission(const std::string& id, | 70 void RemoveAllowedPermission(const std::string& id, |
71 const std::string& permission); | 71 const std::string& permission); |
72 | 72 |
| 73 // Helper functions for 'minimum_version' manipulation. |id| must be a valid |
| 74 // extension ID. |
| 75 void SetMinimumVersion(const std::string& id, const std::string& version); |
| 76 void UnsetMinimumVersion(const std::string& id); |
| 77 |
73 // Expose a read-only preference to user. | 78 // Expose a read-only preference to user. |
74 const base::DictionaryValue* GetPref(); | 79 const base::DictionaryValue* GetPref(); |
75 | 80 |
76 protected: | 81 protected: |
77 // Set the preference with |pref|, pass the ownership of it as well. | 82 // Set the preference with |pref|, pass the ownership of it as well. |
78 // This function must be called before accessing publicly exposed functions, | 83 // This function must be called before accessing publicly exposed functions, |
79 // for example in constructor of subclass. | 84 // for example in constructor of subclass. |
80 void SetPref(base::DictionaryValue* pref); | 85 void SetPref(base::DictionaryValue* pref); |
81 | 86 |
82 // Take the preference. Caller takes ownership of it as well. | 87 // Take the preference. Caller takes ownership of it as well. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 private: | 140 private: |
136 policy::MockConfigurationPolicyProvider* provider_; | 141 policy::MockConfigurationPolicyProvider* provider_; |
137 scoped_ptr<policy::PolicyBundle> policies_; | 142 scoped_ptr<policy::PolicyBundle> policies_; |
138 | 143 |
139 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementPolicyUpdater); | 144 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementPolicyUpdater); |
140 }; | 145 }; |
141 | 146 |
142 } // namespace extensions | 147 } // namespace extensions |
143 | 148 |
144 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_TEST_UTIL_H_ | 149 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_TEST_UTIL_H_ |
OLD | NEW |