Home | History | Annotate | Download | only in extensions
      1 // Copyright (c) 2013 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/common/extensions/chrome_manifest_handlers.h"
      6 
      7 #include "chrome/common/extensions/api/commands/commands_handler.h"
      8 #include "chrome/common/extensions/api/extension_action/browser_action_handler.h"
      9 #include "chrome/common/extensions/api/extension_action/page_action_handler.h"
     10 #include "chrome/common/extensions/api/extension_action/script_badge_handler.h"
     11 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h"
     12 #include "chrome/common/extensions/api/file_handlers/file_handlers_parser.h"
     13 #include "chrome/common/extensions/api/i18n/default_locale_handler.h"
     14 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
     15 #include "chrome/common/extensions/api/storage/storage_schema_manifest_handler.h"
     16 #if defined(OS_CHROMEOS)
     17 #include "chrome/common/extensions/api/input_ime/input_components_handler.h"
     18 #endif
     19 #include "chrome/common/extensions/api/managed_mode_private/managed_mode_handler.h"
     20 #include "chrome/common/extensions/api/media_galleries_private/media_galleries_handler.h"
     21 #include "chrome/common/extensions/api/omnibox/omnibox_handler.h"
     22 #include "chrome/common/extensions/api/plugins/plugins_handler.h"
     23 #include "chrome/common/extensions/api/sockets/sockets_manifest_handler.h"
     24 #include "chrome/common/extensions/api/speech/tts_engine_manifest_handler.h"
     25 #include "chrome/common/extensions/api/spellcheck/spellcheck_handler.h"
     26 #include "chrome/common/extensions/api/system_indicator/system_indicator_handler.h"
     27 #include "chrome/common/extensions/api/url_handlers/url_handlers_parser.h"
     28 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
     29 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
     30 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h"
     31 #include "chrome/common/extensions/manifest_handlers/externally_connectable.h"
     32 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
     33 #include "chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h"
     34 #include "chrome/common/extensions/manifest_handlers/nacl_modules_handler.h"
     35 #include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h"
     36 #include "chrome/common/extensions/manifest_handlers/theme_handler.h"
     37 #include "chrome/common/extensions/manifest_url_handler.h"
     38 #include "chrome/common/extensions/mime_types_handler.h"
     39 #include "chrome/common/extensions/web_accessible_resources_handler.h"
     40 #include "chrome/common/extensions/webview_handler.h"
     41 #include "extensions/common/manifest_handlers/background_info.h"
     42 #include "extensions/common/manifest_handlers/csp_info.h"
     43 #include "extensions/common/manifest_handlers/incognito_info.h"
     44 #include "extensions/common/manifest_handlers/kiosk_mode_info.h"
     45 #include "extensions/common/manifest_handlers/offline_enabled_info.h"
     46 #include "extensions/common/manifest_handlers/requirements_info.h"
     47 #include "extensions/common/manifest_handlers/sandboxed_page_info.h"
     48 #include "extensions/common/manifest_handlers/shared_module_info.h"
     49 
     50 namespace extensions {
     51 
     52 void RegisterChromeManifestHandlers() {
     53   // This can happen in unit tests, where the utility thread runs in-process.
     54   if (ManifestHandler::IsRegistrationFinalized())
     55     return;
     56 #if defined(ENABLE_EXTENSIONS)
     57   (new AppIsolationHandler)->Register();
     58   (new AppLaunchManifestHandler)->Register();
     59   (new BackgroundManifestHandler)->Register();
     60   (new BrowserActionHandler)->Register();
     61   (new CommandsHandler)->Register();
     62   (new ContentScriptsHandler)->Register();
     63   (new CSPHandler(false))->Register();
     64   (new CSPHandler(true))->Register();
     65   (new DefaultLocaleHandler)->Register();
     66   (new DevToolsPageHandler)->Register();
     67   (new ExternallyConnectableHandler)->Register();
     68   (new FileBrowserHandlerParser)->Register();
     69   (new FileHandlersParser)->Register();
     70   (new HomepageURLHandler)->Register();
     71   (new IconsHandler)->Register();
     72   (new IncognitoHandler)->Register();
     73 #if defined(OS_CHROMEOS)
     74   (new InputComponentsHandler)->Register();
     75 #endif
     76   (new KioskModeHandler)->Register();
     77   (new ManagedModeHandler)->Register();
     78   (new MediaGalleriesHandlerParser)->Register();
     79   (new MimeTypesHandlerParser)->Register();
     80   (new MinimumChromeVersionChecker)->Register();
     81   (new NaClModulesHandler)->Register();
     82   (new OAuth2ManifestHandler)->Register();
     83   (new OfflineEnabledHandler)->Register();
     84   (new OmniboxHandler)->Register();
     85   (new OptionsPageHandler)->Register();
     86   (new PageActionHandler)->Register();
     87   (new PluginsHandler)->Register();
     88   (new RequirementsHandler)->Register();
     89   (new SandboxedPageHandler)->Register();
     90   (new SettingsOverridesHandler)->Register();
     91   (new ScriptBadgeHandler)->Register();
     92   (new SharedModuleHandler)->Register();
     93   (new SocketsManifestHandler)->Register();
     94   (new SpellcheckHandler)->Register();
     95   (new StorageSchemaManifestHandler)->Register();
     96   (new SystemIndicatorHandler)->Register();
     97   (new ThemeHandler)->Register();
     98   (new TtsEngineManifestHandler)->Register();
     99   (new UpdateURLHandler)->Register();
    100   (new UrlHandlersParser)->Register();
    101   (new URLOverridesHandler)->Register();
    102   (new WebAccessibleResourcesHandler)->Register();
    103   (new WebviewHandler)->Register();
    104   ManifestHandler::FinalizeRegistration();
    105 #endif
    106 }
    107 
    108 }  // namespace extensions
    109