Chromium Code Reviews| 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) { | 64 void ManagementPolicy::RegisterProviders( |
| 65 providers_.insert(providers.begin(), providers.end()); | 65 const std::vector<std::unique_ptr<Provider>>& providers) { |
| 66 for (const std::unique_ptr<Provider>& provider : providers) | |
| 67 providers_.insert(provider.get()); | |
|
asargent_no_longer_on_chrome
2016/09/06 22:12:40
Hmm, this is a little unusual - when I see unique_
lazyboy
2016/09/06 23:49:38
Ya.
I think this is what ScopedVector was kind of
| |
| 66 } | 68 } |
| 67 | 69 |
| 68 bool ManagementPolicy::UserMayLoad(const Extension* extension, | 70 bool ManagementPolicy::UserMayLoad(const Extension* extension, |
| 69 base::string16* error) const { | 71 base::string16* error) const { |
| 70 return ApplyToProviderList( | 72 return ApplyToProviderList( |
| 71 &Provider::UserMayLoad, "Installation", true, extension, error); | 73 &Provider::UserMayLoad, "Installation", true, extension, error); |
| 72 } | 74 } |
| 73 | 75 |
| 74 bool ManagementPolicy::UserMayModifySettings(const Extension* extension, | 76 bool ManagementPolicy::UserMayModifySettings(const Extension* extension, |
| 75 base::string16* error) const { | 77 base::string16* error) const { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 DVLOG(1) << debug_operation_name << " of extension " << name | 126 DVLOG(1) << debug_operation_name << " of extension " << name |
| 125 << " (" << id << ")" | 127 << " (" << id << ")" |
| 126 << " prohibited by " << provider->GetDebugPolicyProviderName(); | 128 << " prohibited by " << provider->GetDebugPolicyProviderName(); |
| 127 return !normal_result; | 129 return !normal_result; |
| 128 } | 130 } |
| 129 } | 131 } |
| 130 return normal_result; | 132 return normal_result; |
| 131 } | 133 } |
| 132 | 134 |
| 133 } // namespace extensions | 135 } // namespace extensions |
| OLD | NEW |