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..a6a0ea7859a6274284b19a42395e4161ee3b8f2f |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_management_constants.cc |
| @@ -0,0 +1,50 @@ |
| +// 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 <string> |
|
Joao da Silva
2014/09/19 07:27:26
This should be in the .h, for the declaration of G
binjin
2014/09/19 10:06:08
Done.
|
| + |
| +#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 (size_t index = 0; index < kAllowedTypesMapSize; index++) { |
|
Joao da Silva
2014/09/19 07:27:26
++index
binjin
2014/09/19 10:06:08
Done.
|
| + if (kAllowedTypesMap[index].name == name) |
| + return kAllowedTypesMap[index].manifest_type; |
| + } |
| + return Manifest::TYPE_UNKNOWN; |
| +} |
| + |
| +} // namespace schema_constants |
| +} // namespace extensions |