diff options
author | binjin <binjin@chromium.org> | 2014-09-22 08:17:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-22 15:17:54 +0000 |
commit | b245438121f8dba852268c0bed0359c6f31c50c6 (patch) | |
tree | 9deb54191133a416ea2c9cb41498f54fc2fd60c4 /chrome/browser/extensions/extension_management_constants.h | |
parent | f52fe5854ece2fe8ff5093060e2274972311d083 (diff) | |
download | chromium_src-b245438121f8dba852268c0bed0359c6f31c50c6.zip chromium_src-b245438121f8dba852268c0bed0359c6f31c50c6.tar.gz chromium_src-b245438121f8dba852268c0bed0359c6f31c50c6.tar.bz2 |
Add new ExtensionManagement preference
New ExtensionManagement preference is a policy-controlled dictionary preference for management of extensions.
Current implementation covers all legacy extension management preference (installation_mode, install_sources, allowed_types).
This CL includes extension preference parsing, definition of constants strings for properties/string enums in the new dictionary value, and a test helper class for manipulating it in unit tests.
BUG=177351
Review URL: https://codereview.chromium.org/559603002
Cr-Commit-Position: refs/heads/master@{#295974}
Diffstat (limited to 'chrome/browser/extensions/extension_management_constants.h')
-rw-r--r-- | chrome/browser/extensions/extension_management_constants.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_management_constants.h b/chrome/browser/extensions/extension_management_constants.h new file mode 100644 index 0000000..63a50aa --- /dev/null +++ b/chrome/browser/extensions/extension_management_constants.h @@ -0,0 +1,47 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_CONSTANTS_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_CONSTANTS_H_ + +#include <string> + +#include "extensions/common/manifest.h" + +namespace extensions { +namespace schema_constants { + +extern const char kWildcard[]; + +extern const char kInstallationMode[]; +extern const char kAllowed[]; +extern const char kBlocked[]; +extern const char kForceInstalled[]; +extern const char kNormalInstalled[]; + +extern const char kUpdateUrl[]; +extern const char kInstallSources[]; +extern const char kAllowedTypes[]; + +extern const char kUpdateUrlPrefix[]; + +struct AllowedTypesMapEntry { + // Name of allowed types of extensions used in schema of extension + // management preference. + const char* name; + // The corresponding Manifest::Type. + Manifest::Type manifest_type; +}; + +extern const size_t kAllowedTypesMapSize; +extern const AllowedTypesMapEntry kAllowedTypesMap[]; + +// Helper fuction over |kAllowedTypesMap|, returns Manifest::TYPE_UNKNOWN if +// not found. +Manifest::Type GetManifestType(const std::string& name); + +} // namespace schema_constants +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_CONSTANTS_H_ |