| 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 #include "extensions/browser/management_policy.h" | 5 #include "extensions/browser/management_policy.h" |
| 6 | 6 |
| 7 namespace extensions { | 7 namespace extensions { |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ManagementPolicy::RegisterProvider(Provider* provider) { | 56 void ManagementPolicy::RegisterProvider(Provider* provider) { |
| 57 providers_.insert(provider); | 57 providers_.insert(provider); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ManagementPolicy::UnregisterProvider(Provider* provider) { | 60 void ManagementPolicy::UnregisterProvider(Provider* provider) { |
| 61 providers_.erase(provider); | 61 providers_.erase(provider); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ManagementPolicy::RegisterProviders(std::vector<Provider*> providers) { |
| 65 providers_.insert(providers.begin(), providers.end()); |
| 66 } |
| 67 |
| 64 bool ManagementPolicy::UserMayLoad(const Extension* extension, | 68 bool ManagementPolicy::UserMayLoad(const Extension* extension, |
| 65 base::string16* error) const { | 69 base::string16* error) const { |
| 66 return ApplyToProviderList( | 70 return ApplyToProviderList( |
| 67 &Provider::UserMayLoad, "Installation", true, extension, error); | 71 &Provider::UserMayLoad, "Installation", true, extension, error); |
| 68 } | 72 } |
| 69 | 73 |
| 70 bool ManagementPolicy::UserMayModifySettings(const Extension* extension, | 74 bool ManagementPolicy::UserMayModifySettings(const Extension* extension, |
| 71 base::string16* error) const { | 75 base::string16* error) const { |
| 72 return ApplyToProviderList( | 76 return ApplyToProviderList( |
| 73 &Provider::UserMayModifySettings, "Modification", true, extension, error); | 77 &Provider::UserMayModifySettings, "Modification", true, extension, error); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 DVLOG(1) << debug_operation_name << " of extension " << name | 124 DVLOG(1) << debug_operation_name << " of extension " << name |
| 121 << " (" << id << ")" | 125 << " (" << id << ")" |
| 122 << " prohibited by " << provider->GetDebugPolicyProviderName(); | 126 << " prohibited by " << provider->GetDebugPolicyProviderName(); |
| 123 return !normal_result; | 127 return !normal_result; |
| 124 } | 128 } |
| 125 } | 129 } |
| 126 return normal_result; | 130 return normal_result; |
| 127 } | 131 } |
| 128 | 132 |
| 129 } // namespace extensions | 133 } // namespace extensions |
| OLD | NEW |