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/browser/extensions/extension_management_constants.cc

Issue 559603002: Add new ExtensionManagement preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes addressing #2 Created 6 years, 3 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
OLDNEW
(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 "base/macros.h"
8
9 namespace extensions {
10 namespace schema_constants {
11
12 const char kWildcard[] = "*";
13
14 const char kInstallationMode[] = "installation_mode";
15 const char kAllowed[] = "allowed";
16 const char kBlocked[] = "blocked";
17 const char kForceInstalled[] = "force_installed";
18 const char kNormalInstalled[] = "normal_installed";
19
20 const char kUpdateUrl[] = "update_url";
21 const char kInstallSources[] = "install_sources";
22 const char kAllowedTypes[] = "allowed_types";
23
24 const char kUpdateUrlPrefix[] = "update_url:";
25
26 const AllowedTypesMapEntry kAllowedTypesMap[] = {
27 { "extension", Manifest::TYPE_EXTENSION },
28 { "theme", Manifest::TYPE_THEME },
29 { "user_script", Manifest::TYPE_USER_SCRIPT },
30 { "hosted_app", Manifest::TYPE_HOSTED_APP },
31 { "legacy_packaged_app", Manifest::TYPE_LEGACY_PACKAGED_APP },
32 { "platform_app", Manifest::TYPE_PLATFORM_APP },
33 // TODO(binjin): Add shared_module type here and update ExtensionAllowedTypes
34 // policy.
35 };
36
37 const size_t kAllowedTypesMapSize = arraysize(kAllowedTypesMap);
38
39 Manifest::Type GetManifestType(const std::string& name) {
40 for (const schema_constants::AllowedTypesMapEntry* iter =
41 schema_constants::kAllowedTypesMap;
42 iter->name;
43 ++iter) {
Joao da Silva 2014/09/18 15:23:52 This doesn't work anymore, because there is no NUL
binjin 2014/09/18 15:49:03 Done.
44 if (iter->name == name)
45 return iter->manifest_type;
46 }
47 return Manifest::TYPE_UNKNOWN;
48 }
49
50 } // namespace schema_constants
51 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698