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

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: make test extension ID tests pass 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
« no previous file with comments | « chrome/common/extensions/feature.h ('k') | chrome/common/extensions/feature_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/stringprintf.h" 11 #include "base/stringprintf.h"
12 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
13 13
14 namespace { 14 namespace {
15 15
16 struct Mappings { 16 struct Mappings {
17 Mappings() { 17 Mappings() {
18 extension_types["extension"] = Extension::TYPE_EXTENSION; 18 extension_types["extension"] = Extension::TYPE_EXTENSION;
19 extension_types["theme"] = Extension::TYPE_THEME; 19 extension_types["theme"] = Extension::TYPE_THEME;
20 extension_types["packaged_app"] = Extension::TYPE_PACKAGED_APP; 20 extension_types["packaged_app"] = Extension::TYPE_PACKAGED_APP;
21 extension_types["hosted_app"] = Extension::TYPE_HOSTED_APP; 21 extension_types["hosted_app"] = Extension::TYPE_HOSTED_APP;
22 extension_types["platform_app"] = Extension::TYPE_PLATFORM_APP; 22 extension_types["platform_app"] = Extension::TYPE_PLATFORM_APP;
23 23
24 contexts["privileged"] = extensions::Feature::PRIVILEGED_CONTEXT; 24 contexts["privileged"] = extensions::Feature::PRIVILEGED_CONTEXT;
25 contexts["unprivileged"] = extensions::Feature::UNPRIVILEGED_CONTEXT; 25 contexts["unprivileged"] = extensions::Feature::UNPRIVILEGED_CONTEXT;
26 contexts["content_script"] = extensions::Feature::CONTENT_SCRIPT_CONTEXT; 26 contexts["content_script"] = extensions::Feature::CONTENT_SCRIPT_CONTEXT;
27 contexts["web_page"] = extensions::Feature::WEB_PAGE_CONTEXT;
27 28
28 locations["component"] = extensions::Feature::COMPONENT_LOCATION; 29 locations["component"] = extensions::Feature::COMPONENT_LOCATION;
29 30
30 platforms["chromeos"] = extensions::Feature::CHROMEOS_PLATFORM; 31 platforms["chromeos"] = extensions::Feature::CHROMEOS_PLATFORM;
31 } 32 }
32 33
33 std::map<std::string, Extension::Type> extension_types; 34 std::map<std::string, Extension::Type> extension_types;
34 std::map<std::string, extensions::Feature::Context> contexts; 35 std::map<std::string, extensions::Feature::Context> contexts;
35 std::map<std::string, extensions::Feature::Location> locations; 36 std::map<std::string, extensions::Feature::Location> locations;
36 std::map<std::string, extensions::Feature::Platform> platforms; 37 std::map<std::string, extensions::Feature::Platform> platforms;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (min_manifest_version_ != 0 && manifest_version < min_manifest_version_) 227 if (min_manifest_version_ != 0 && manifest_version < min_manifest_version_)
227 return INVALID_MIN_MANIFEST_VERSION; 228 return INVALID_MIN_MANIFEST_VERSION;
228 229
229 if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_) 230 if (max_manifest_version_ != 0 && manifest_version > max_manifest_version_)
230 return INVALID_MAX_MANIFEST_VERSION; 231 return INVALID_MAX_MANIFEST_VERSION;
231 232
232 return IS_AVAILABLE; 233 return IS_AVAILABLE;
233 } 234 }
234 235
235 } // namespace 236 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/feature.h ('k') | chrome/common/extensions/feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698