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

Unified Diff: chrome/common/extensions/chrome_extensions_client.cc

Issue 573933002: Cleanup: Remove remaining generated extensions APIs on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extclean4
Patch Set: fix build some more after rebasing 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/schemas.gypi ('k') | extensions/common/api/schemas.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/chrome_extensions_client.cc
diff --git a/chrome/common/extensions/chrome_extensions_client.cc b/chrome/common/extensions/chrome_extensions_client.cc
index e72162cc9f39c8154a44e2a06e1257d923196f10..f9ce7e72909cef7ca3592bd19aeaf5d2caa8fa81 100644
--- a/chrome/common/extensions/chrome_extensions_client.cc
+++ b/chrome/common/extensions/chrome_extensions_client.cc
@@ -8,7 +8,6 @@
#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"
@@ -18,7 +17,6 @@
#include "chrome/grit/common_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"
@@ -41,8 +39,12 @@
#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 {
@@ -83,7 +85,9 @@ void ChromeExtensionsClient::Initialize() {
// thread runs in-process.
if (!ManifestHandler::IsRegistrationFinalized()) {
RegisterCommonManifestHandlers();
+#if defined(ENABLE_EXTENSIONS)
RegisterChromeManifestHandlers();
+#endif
ManifestHandler::FinalizeRegistration();
}
@@ -230,18 +234,26 @@ 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(
« no previous file with comments | « chrome/common/extensions/api/schemas.gypi ('k') | extensions/common/api/schemas.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698