Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: extensions/browser/management_policy.cc

Issue 595363002: Add policy controlled permission block list for extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-fix
Patch Set: fix memory leaks Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/management_policy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/management_policy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698