Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/common/extensions/feature.cc

Issue 9460002: Convert app_bindings.js to the schema_generated_bindings.js infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix koz bool thing Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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;
24 25
25 locations["component"] = extensions::Feature::COMPONENT_LOCATION; 26 locations["component"] = extensions::Feature::COMPONENT_LOCATION;
26 27
27 platforms["chromeos"] = extensions::Feature::CHROMEOS_PLATFORM; 28 platforms["chromeos"] = extensions::Feature::CHROMEOS_PLATFORM;
28 } 29 }
29 30
30 std::map<std::string, Extension::Type> extension_types; 31 std::map<std::string, Extension::Type> extension_types;
31 std::map<std::string, extensions::Feature::Context> contexts; 32 std::map<std::string, extensions::Feature::Context> contexts;
32 std::map<std::string, extensions::Feature::Location> locations; 33 std::map<std::string, extensions::Feature::Location> locations;
33 std::map<std::string, extensions::Feature::Platform> platforms; 34 std::map<std::string, extensions::Feature::Platform> platforms;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (min_manifest_version_ != 0 && manifest_version < min_manifest_version_) 182 if (min_manifest_version_ != 0 && manifest_version < min_manifest_version_)
182 return false; 183 return false;
183 184
184 if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_) 185 if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_)
185 return false; 186 return false;
186 187
187 return true; 188 return true;
188 } 189 }
189 190
190 } // namespace 191 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698