Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / chrome_extensions_client.cc
index f9ce7e7..8f86d74 100644 (file)
@@ -8,6 +8,7 @@
 #include "base/strings/string_util.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/chrome_version_info.h"
+#include "chrome/common/extensions/api/generated_schemas.h"
 #include "chrome/common/extensions/chrome_manifest_handlers.h"
 #include "chrome/common/extensions/extension_constants.h"
 #include "chrome/common/extensions/features/chrome_channel_feature_filter.h"
 #include "chrome/common/url_constants.h"
 #include "chrome/grit/chromium_strings.h"
 #include "chrome/grit/common_resources.h"
+#include "chrome/grit/extensions_api_resources.h"
 #include "chrome/grit/generated_resources.h"
 #include "content/public/common/url_constants.h"
+#include "extensions/common/api/generated_schemas.h"
 #include "extensions/common/common_manifest_handlers.h"
 #include "extensions/common/extension.h"
 #include "extensions/common/extension_api.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "url/gurl.h"
 
-// TODO(thestig): Remove these #defines. This file should not be built when
-// extensions are disabled.
-#if defined(ENABLE_EXTENSIONS)
-#include "chrome/common/extensions/api/generated_schemas.h"
-#include "chrome/grit/extensions_api_resources.h"
-#include "extensions/common/api/generated_schemas.h"
-#endif
-
 namespace extensions {
 
 namespace {
@@ -85,9 +80,7 @@ void ChromeExtensionsClient::Initialize() {
   // thread runs in-process.
   if (!ManifestHandler::IsRegistrationFinalized()) {
     RegisterCommonManifestHandlers();
-#if defined(ENABLE_EXTENSIONS)
     RegisterChromeManifestHandlers();
-#endif
     ManifestHandler::FinalizeRegistration();
   }
 
@@ -234,31 +227,22 @@ bool ChromeExtensionsClient::IsScriptableURL(
 
 bool ChromeExtensionsClient::IsAPISchemaGenerated(
     const std::string& name) const {
-#if defined(ENABLE_EXTENSIONS)
   // Test from most common to least common.
   return api::GeneratedSchemas::IsGenerated(name) ||
          core_api::GeneratedSchemas::IsGenerated(name);
-#else
-  return false;
-#endif
 }
 
 base::StringPiece ChromeExtensionsClient::GetAPISchema(
     const std::string& name) const {
-#if defined(ENABLE_EXTENSIONS)
   // Test from most common to least common.
   if (api::GeneratedSchemas::IsGenerated(name))
     return api::GeneratedSchemas::Get(name);
 
   return core_api::GeneratedSchemas::Get(name);
-#else
-  return base::StringPiece();
-#endif
 }
 
 void ChromeExtensionsClient::RegisterAPISchemaResources(
     ExtensionAPI* api) const {
-#if defined(ENABLE_EXTENSIONS)
   api->RegisterSchemaResource("accessibilityPrivate",
                               IDR_EXTENSION_API_JSON_ACCESSIBILITYPRIVATE);
   api->RegisterSchemaResource("app", IDR_EXTENSION_API_JSON_APP);
@@ -267,8 +251,6 @@ void ChromeExtensionsClient::RegisterAPISchemaResources(
   api->RegisterSchemaResource("commands", IDR_EXTENSION_API_JSON_COMMANDS);
   api->RegisterSchemaResource("declarativeContent",
                               IDR_EXTENSION_API_JSON_DECLARATIVE_CONTENT);
-  api->RegisterSchemaResource("declarativeWebRequest",
-                              IDR_EXTENSION_API_JSON_DECLARATIVE_WEBREQUEST);
   api->RegisterSchemaResource("fileBrowserHandler",
                               IDR_EXTENSION_API_JSON_FILEBROWSERHANDLER);
   api->RegisterSchemaResource("inputMethodPrivate",
@@ -285,9 +267,6 @@ void ChromeExtensionsClient::RegisterAPISchemaResources(
   api->RegisterSchemaResource("types.private",
                               IDR_EXTENSION_API_JSON_TYPES_PRIVATE);
   api->RegisterSchemaResource("webstore", IDR_EXTENSION_API_JSON_WEBSTORE);
-  api->RegisterSchemaResource("webViewRequest",
-                              IDR_EXTENSION_API_JSON_WEB_VIEW_REQUEST);
-#endif  // defined(ENABLE_EXTENSIONS)
 }
 
 bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const {