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

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: fix 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 <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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698