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 #include "chrome/browser/extensions/admin_policy.h" | 5 #include "chrome/browser/extensions/admin_policy.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "chrome/common/extensions/manifest.h" | 9 #include "chrome/common/extensions/manifest.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // kExtensionAllowedTypesMap in configuration_policy_handler_list.cc. | 73 // kExtensionAllowedTypesMap in configuration_policy_handler_list.cc. |
74 switch (extension->GetType()) { | 74 switch (extension->GetType()) { |
75 case Manifest::TYPE_UNKNOWN: | 75 case Manifest::TYPE_UNKNOWN: |
76 break; | 76 break; |
77 case Manifest::TYPE_EXTENSION: | 77 case Manifest::TYPE_EXTENSION: |
78 case Manifest::TYPE_THEME: | 78 case Manifest::TYPE_THEME: |
79 case Manifest::TYPE_USER_SCRIPT: | 79 case Manifest::TYPE_USER_SCRIPT: |
80 case Manifest::TYPE_HOSTED_APP: | 80 case Manifest::TYPE_HOSTED_APP: |
81 case Manifest::TYPE_LEGACY_PACKAGED_APP: | 81 case Manifest::TYPE_LEGACY_PACKAGED_APP: |
82 case Manifest::TYPE_PLATFORM_APP: | 82 case Manifest::TYPE_PLATFORM_APP: |
| 83 case Manifest::TYPE_SHARED_MODULE: |
83 base::FundamentalValue type_value(extension->GetType()); | 84 base::FundamentalValue type_value(extension->GetType()); |
84 if (allowed_types && | 85 if (allowed_types && |
85 allowed_types->Find(type_value) == allowed_types->end()) | 86 allowed_types->Find(type_value) == allowed_types->end()) |
86 return ReturnLoadError(extension, error); | 87 return ReturnLoadError(extension, error); |
87 break; | 88 break; |
88 } | 89 } |
89 | 90 |
90 // Check the whitelist/forcelist first. | 91 // Check the whitelist/forcelist first. |
91 base::StringValue id_value(extension->id()); | 92 base::StringValue id_value(extension->id()); |
92 if ((whitelist && whitelist->Find(id_value) != whitelist->end()) || | 93 if ((whitelist && whitelist->Find(id_value) != whitelist->end()) || |
(...skipping 11 matching lines...) Expand all Loading... |
104 bool UserMayModifySettings(const Extension* extension, string16* error) { | 105 bool UserMayModifySettings(const Extension* extension, string16* error) { |
105 return ManagementPolicyImpl(extension, error, true); | 106 return ManagementPolicyImpl(extension, error, true); |
106 } | 107 } |
107 | 108 |
108 bool MustRemainEnabled(const Extension* extension, string16* error) { | 109 bool MustRemainEnabled(const Extension* extension, string16* error) { |
109 return ManagementPolicyImpl(extension, error, false); | 110 return ManagementPolicyImpl(extension, error, false); |
110 } | 111 } |
111 | 112 |
112 } // namespace | 113 } // namespace |
113 } // namespace | 114 } // namespace |
OLD | NEW |