diff options
Diffstat (limited to 'extensions/common')
-rw-r--r-- | extensions/common/common_manifest_handlers.cc | 30 | ||||
-rw-r--r-- | extensions/common/common_manifest_handlers.h | 17 | ||||
-rw-r--r-- | extensions/common/extensions_client.h | 2 | ||||
-rw-r--r-- | extensions/common/manifest_handler.h | 2 |
4 files changed, 50 insertions, 1 deletions
diff --git a/extensions/common/common_manifest_handlers.cc b/extensions/common/common_manifest_handlers.cc new file mode 100644 index 0000000..bbea1c2 --- /dev/null +++ b/extensions/common/common_manifest_handlers.cc @@ -0,0 +1,30 @@ +// 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. + +#include "extensions/common/common_manifest_handlers.h" + +#include "extensions/common/manifest_handler.h" +#include "extensions/common/manifest_handlers/background_info.h" +#include "extensions/common/manifest_handlers/csp_info.h" +#include "extensions/common/manifest_handlers/incognito_info.h" +#include "extensions/common/manifest_handlers/kiosk_mode_info.h" +#include "extensions/common/manifest_handlers/offline_enabled_info.h" +#include "extensions/common/manifest_handlers/sandboxed_page_info.h" +#include "extensions/common/manifest_handlers/shared_module_info.h" + +namespace extensions { + +void RegisterCommonManifestHandlers() { + DCHECK(!ManifestHandler::IsRegistrationFinalized()); + (new BackgroundManifestHandler)->Register(); + (new CSPHandler(false))->Register(); + (new CSPHandler(true))->Register(); + (new IncognitoHandler)->Register(); + (new KioskModeHandler)->Register(); + (new OfflineEnabledHandler)->Register(); + (new SandboxedPageHandler)->Register(); + (new SharedModuleHandler)->Register(); +} + +} // namespace extensions diff --git a/extensions/common/common_manifest_handlers.h b/extensions/common/common_manifest_handlers.h new file mode 100644 index 0000000..4f1d7cc --- /dev/null +++ b/extensions/common/common_manifest_handlers.h @@ -0,0 +1,17 @@ +// 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 EXTENSIONS_COMMON_COMMON_MANIFEST_HANDLERS_H_ +#define EXTENSIONS_COMMON_COMMON_MANIFEST_HANDLERS_H_ + +namespace extensions { + +// Registers manifest handlers used by all embedders of the extensions system. +// Should be called once in each process. Embedders may also wish to register +// their own set of manifest handlers, such as chrome_manifest_handlers.cc. +void RegisterCommonManifestHandlers(); + +} // namespace extensions + +#endif // EXTENSIONS_COMMON_COMMON_MANIFEST_HANDLERS_H_ diff --git a/extensions/common/extensions_client.h b/extensions/common/extensions_client.h index fb6aba8..d309fd7 100644 --- a/extensions/common/extensions_client.h +++ b/extensions/common/extensions_client.h @@ -28,6 +28,8 @@ class ExtensionsClient { public: typedef std::vector<std::string> ScriptingWhitelist; + virtual ~ExtensionsClient() {} + // Initializes global state. Not done in the constructor because unit tests // can create additional ExtensionsClients because the utility thread runs // in-process. diff --git a/extensions/common/manifest_handler.h b/extensions/common/manifest_handler.h index a6963f4..4c7da31 100644 --- a/extensions/common/manifest_handler.h +++ b/extensions/common/manifest_handler.h @@ -62,7 +62,7 @@ class ManifestHandler { // for multiple keys. The global registry takes ownership of this; // if it has an existing handler for |key|, it replaces it with this. // Manifest handlers must be registered at process startup in - // chrome_manifest_handlers.cc: + // common_manifest_handlers.cc or chrome_manifest_handlers.cc: // (new MyManifestHandler)->Register(); void Register(); |