| 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/common/extensions/feature.h" | 5 #include "chrome/common/extensions/feature.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 struct Mappings { | 13 struct Mappings { |
| 14 Mappings() { | 14 Mappings() { |
| 15 extension_types["extension"] = Extension::TYPE_EXTENSION; | 15 extension_types["extension"] = Extension::TYPE_EXTENSION; |
| 16 extension_types["theme"] = Extension::TYPE_THEME; | 16 extension_types["theme"] = Extension::TYPE_THEME; |
| 17 extension_types["packaged_app"] = Extension::TYPE_PACKAGED_APP; | 17 extension_types["packaged_app"] = Extension::TYPE_PACKAGED_APP; |
| 18 extension_types["hosted_app"] = Extension::TYPE_HOSTED_APP; | 18 extension_types["hosted_app"] = Extension::TYPE_HOSTED_APP; |
| 19 extension_types["platform_app"] = Extension::TYPE_PLATFORM_APP; | 19 extension_types["platform_app"] = Extension::TYPE_PLATFORM_APP; |
| 20 | 20 |
| 21 contexts["privileged"] = extensions::Feature::PRIVILEGED_CONTEXT; | 21 contexts["privileged"] = extensions::Feature::PRIVILEGED_CONTEXT; |
| 22 contexts["unprivileged"] = extensions::Feature::UNPRIVILEGED_CONTEXT; | 22 contexts["unprivileged"] = extensions::Feature::UNPRIVILEGED_CONTEXT; |
| 23 contexts["content_script"] = extensions::Feature::CONTENT_SCRIPT_CONTEXT; | 23 contexts["content_script"] = extensions::Feature::CONTENT_SCRIPT_CONTEXT; |
| 24 contexts["web_page"] = extensions::Feature::WEB_PAGE_CONTEXT; | |
| 25 | 24 |
| 26 locations["component"] = extensions::Feature::COMPONENT_LOCATION; | 25 locations["component"] = extensions::Feature::COMPONENT_LOCATION; |
| 27 | 26 |
| 28 platforms["chromeos"] = extensions::Feature::CHROMEOS_PLATFORM; | 27 platforms["chromeos"] = extensions::Feature::CHROMEOS_PLATFORM; |
| 29 } | 28 } |
| 30 | 29 |
| 31 std::map<std::string, Extension::Type> extension_types; | 30 std::map<std::string, Extension::Type> extension_types; |
| 32 std::map<std::string, extensions::Feature::Context> contexts; | 31 std::map<std::string, extensions::Feature::Context> contexts; |
| 33 std::map<std::string, extensions::Feature::Location> locations; | 32 std::map<std::string, extensions::Feature::Location> locations; |
| 34 std::map<std::string, extensions::Feature::Platform> platforms; | 33 std::map<std::string, extensions::Feature::Platform> platforms; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (min_manifest_version_ != 0 && manifest_version < min_manifest_version_) | 181 if (min_manifest_version_ != 0 && manifest_version < min_manifest_version_) |
| 183 return false; | 182 return false; |
| 184 | 183 |
| 185 if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_) | 184 if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_) |
| 186 return false; | 185 return false; |
| 187 | 186 |
| 188 return true; | 187 return true; |
| 189 } | 188 } |
| 190 | 189 |
| 191 } // namespace | 190 } // namespace |
| OLD | NEW |