Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / chrome / browser / extensions / extension_management_constants.cc
blobb86b552bc8144df91d8b8d5196484268706ec653
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/extension_management_constants.h"
7 #include "base/macros.h"
9 namespace extensions {
10 namespace schema_constants {
12 const char kWildcard[] = "*";
14 const char kInstallationMode[] = "installation_mode";
15 const char kAllowed[] = "allowed";
16 const char kBlocked[] = "blocked";
17 const char kForceInstalled[] = "force_installed";
18 const char kNormalInstalled[] = "normal_installed";
20 const char kBlockedPermissions[] = "blocked_permissions";
21 const char kAllowedPermissions[] = "allowed_permissions";
23 const char kUpdateUrl[] = "update_url";
24 const char kInstallSources[] = "install_sources";
25 const char kAllowedTypes[] = "allowed_types";
27 const char kMinimumVersionRequired[] = "minimum_version_required";
29 const char kUpdateUrlPrefix[] = "update_url:";
31 const AllowedTypesMapEntry kAllowedTypesMap[] = {
32 { "extension", Manifest::TYPE_EXTENSION },
33 { "theme", Manifest::TYPE_THEME },
34 { "user_script", Manifest::TYPE_USER_SCRIPT },
35 { "hosted_app", Manifest::TYPE_HOSTED_APP },
36 { "legacy_packaged_app", Manifest::TYPE_LEGACY_PACKAGED_APP },
37 { "platform_app", Manifest::TYPE_PLATFORM_APP },
38 // TODO(binjin): Add shared_module type here and update ExtensionAllowedTypes
39 // policy.
42 const size_t kAllowedTypesMapSize = arraysize(kAllowedTypesMap);
44 Manifest::Type GetManifestType(const std::string& name) {
45 for (size_t index = 0; index < kAllowedTypesMapSize; ++index) {
46 if (kAllowedTypesMap[index].name == name)
47 return kAllowedTypesMap[index].manifest_type;
49 return Manifest::TYPE_UNKNOWN;
52 } // namespace schema_constants
53 } // namespace extensions