OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #include "chrome/browser/extensions/extension_management_constants.h" | |
6 | |
7 #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.
| |
8 | |
9 #include "base/macros.h" | |
10 | |
11 namespace extensions { | |
12 namespace schema_constants { | |
13 | |
14 const char kWildcard[] = "*"; | |
15 | |
16 const char kInstallationMode[] = "installation_mode"; | |
17 const char kAllowed[] = "allowed"; | |
18 const char kBlocked[] = "blocked"; | |
19 const char kForceInstalled[] = "force_installed"; | |
20 const char kNormalInstalled[] = "normal_installed"; | |
21 | |
22 const char kUpdateUrl[] = "update_url"; | |
23 const char kInstallSources[] = "install_sources"; | |
24 const char kAllowedTypes[] = "allowed_types"; | |
25 | |
26 const char kUpdateUrlPrefix[] = "update_url:"; | |
27 | |
28 const AllowedTypesMapEntry kAllowedTypesMap[] = { | |
29 { "extension", Manifest::TYPE_EXTENSION }, | |
30 { "theme", Manifest::TYPE_THEME }, | |
31 { "user_script", Manifest::TYPE_USER_SCRIPT }, | |
32 { "hosted_app", Manifest::TYPE_HOSTED_APP }, | |
33 { "legacy_packaged_app", Manifest::TYPE_LEGACY_PACKAGED_APP }, | |
34 { "platform_app", Manifest::TYPE_PLATFORM_APP }, | |
35 // TODO(binjin): Add shared_module type here and update ExtensionAllowedTypes | |
36 // policy. | |
37 }; | |
38 | |
39 const size_t kAllowedTypesMapSize = arraysize(kAllowedTypesMap); | |
40 | |
41 Manifest::Type GetManifestType(const std::string& name) { | |
42 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.
| |
43 if (kAllowedTypesMap[index].name == name) | |
44 return kAllowedTypesMap[index].manifest_type; | |
45 } | |
46 return Manifest::TYPE_UNKNOWN; | |
47 } | |
48 | |
49 } // namespace schema_constants | |
50 } // namespace extensions | |
OLD | NEW |