Chromium Code Reviews| Index: chrome/browser/extensions/extension_management_constants.cc |
| diff --git a/chrome/browser/extensions/extension_management_constants.cc b/chrome/browser/extensions/extension_management_constants.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..894903f9ecd1982ee1704b50181c04ff8dadedff |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_management_constants.cc |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/extensions/extension_management_constants.h" |
| + |
| +#include "base/macros.h" |
| + |
| +namespace extensions { |
| +namespace schema_constants { |
| + |
| +const char kWildcard[] = "*"; |
| + |
| +const char kInstallationMode[] = "installation_mode"; |
| +const char kAllowed[] = "allowed"; |
| +const char kBlocked[] = "blocked"; |
| +const char kForceInstalled[] = "force_installed"; |
| +const char kNormalInstalled[] = "normal_installed"; |
| + |
| +const char kUpdateUrl[] = "update_url"; |
| +const char kInstallSources[] = "install_sources"; |
| +const char kAllowedTypes[] = "allowed_types"; |
| + |
| +const char kUpdateUrlPrefix[] = "update_url:"; |
| + |
| +const AllowedTypesMapEntry kAllowedTypesMap[] = { |
| + { "extension", Manifest::TYPE_EXTENSION }, |
| + { "theme", Manifest::TYPE_THEME }, |
| + { "user_script", Manifest::TYPE_USER_SCRIPT }, |
| + { "hosted_app", Manifest::TYPE_HOSTED_APP }, |
| + { "legacy_packaged_app", Manifest::TYPE_LEGACY_PACKAGED_APP }, |
| + { "platform_app", Manifest::TYPE_PLATFORM_APP }, |
| + // TODO(binjin): Add shared_module type here and update ExtensionAllowedTypes |
| + // policy. |
| +}; |
| + |
| +const size_t kAllowedTypesMapSize = arraysize(kAllowedTypesMap); |
| + |
| +Manifest::Type GetManifestType(const std::string& name) { |
| + for (const schema_constants::AllowedTypesMapEntry* iter = |
| + schema_constants::kAllowedTypesMap; |
| + iter->name; |
| + ++iter) { |
|
Joao da Silva
2014/09/18 15:23:52
This doesn't work anymore, because there is no NUL
binjin
2014/09/18 15:49:03
Done.
|
| + if (iter->name == name) |
| + return iter->manifest_type; |
| + } |
| + return Manifest::TYPE_UNKNOWN; |
| +} |
| + |
| +} // namespace schema_constants |
| +} // namespace extensions |