Commit b2454bd7 authored by thestig's avatar thestig Committed by Commit bot

Revert of Cleanup: Remove remaining generated extensions APIs on Android....

Revert of Cleanup: Remove remaining generated extensions APIs on Android. (patchset #4 id:60001 of https://codereview.chromium.org/573933002/)

Reason for revert:
Android bot fails with error: gen/extensions/common/api/generated_schemas.cc: No such file or directory

Original issue's description:
> Cleanup: Remove remaining generated extensions APIs on Android.
>
> BUG=305852
>
> Committed: https://crrev.com/379f0be47f454cce5c912f25d1b3302ba679b472
> Cr-Commit-Position: refs/heads/master@{#295669}

TBR=yoz@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=305852

Review URL: https://codereview.chromium.org/582933003

Cr-Commit-Position: refs/heads/master@{#295670}
parent 379f0be4
......@@ -32,14 +32,11 @@
#include "components/omnibox/autocomplete_result.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(ENABLE_EXTENSIONS)
#include "extensions/browser/notification_types.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/value_builder.h"
#endif
#include "testing/gtest/include/gtest/gtest.h"
using base::ASCIIToUTF16;
......@@ -822,7 +819,6 @@ TEST_F(ShortcutsProviderTest, DeleteMatch) {
backend_->shortcuts_map().find(ASCIIToUTF16("delete")));
}
#if defined(ENABLE_EXTENSIONS)
TEST_F(ShortcutsProviderTest, Extension) {
// Try an input string that matches an extension URL.
base::string16 text(ASCIIToUTF16("echo"));
......@@ -851,4 +847,3 @@ TEST_F(ShortcutsProviderTest, Extension) {
// Now the URL should have disappeared.
RunTest(text, false, ExpectedURLs(), std::string(), base::string16());
}
#endif
......@@ -9,11 +9,8 @@
#include "components/policy/core/browser/configuration_policy_pref_store_test.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/schema.h"
#include "policy/policy_constants.h"
#if defined(ENABLE_EXTENSIONS)
#include "extensions/common/value_builder.h"
#endif
#include "policy/policy_constants.h"
namespace policy {
......@@ -26,7 +23,6 @@ class ManagedBookmarksPolicyHandlerTest
}
};
#if defined(ENABLE_EXTENSIONS)
TEST_F(ManagedBookmarksPolicyHandlerTest, ApplyPolicySettings) {
EXPECT_FALSE(store_->GetValue(bookmarks::prefs::kManagedBookmarks, NULL));
......@@ -105,7 +101,6 @@ TEST_F(ManagedBookmarksPolicyHandlerTest, ApplyPolicySettings) {
.Build());
EXPECT_TRUE(pref_value->Equals(expected.get()));
}
#endif // defined(ENABLE_EXTENSIONS)
TEST_F(ManagedBookmarksPolicyHandlerTest, WrongPolicyType) {
PolicyMap policy;
......@@ -126,7 +121,6 @@ TEST_F(ManagedBookmarksPolicyHandlerTest, WrongPolicyType) {
EXPECT_FALSE(store_->GetValue(bookmarks::prefs::kManagedBookmarks, NULL));
}
#if defined(ENABLE_EXTENSIONS)
TEST_F(ManagedBookmarksPolicyHandlerTest, UnknownKeys) {
PolicyMap policy;
policy.Set(key::kManagedBookmarks,
......@@ -155,9 +149,7 @@ TEST_F(ManagedBookmarksPolicyHandlerTest, UnknownKeys) {
.Build());
EXPECT_TRUE(pref_value->Equals(expected.get()));
}
#endif
#if defined(ENABLE_EXTENSIONS)
TEST_F(ManagedBookmarksPolicyHandlerTest, BadBookmark) {
PolicyMap policy;
policy.Set(key::kManagedBookmarks,
......@@ -197,6 +189,5 @@ TEST_F(ManagedBookmarksPolicyHandlerTest, BadBookmark) {
.Build());
EXPECT_TRUE(pref_value->Equals(expected.get()));
}
#endif
} // namespace policy
......@@ -2885,6 +2885,8 @@
['OS != "ios"', {
'dependencies': [
'apps',
'browser/extensions/api/api_registration.gyp:chrome_api_registration',
'common/extensions/api/api.gyp:chrome_api',
'debugger',
'installer_util',
'../third_party/re2/re2.gyp:re2',
......@@ -3010,8 +3012,6 @@
['enable_extensions==1', {
'dependencies': [
'browser_extensions',
'browser/extensions/api/api_registration.gyp:chrome_api_registration',
'common/extensions/api/api.gyp:chrome_api',
'sync_file_system_drive_proto',
],
'sources': [ '<@(chrome_browser_extensions_sources)' ],
......
......@@ -2608,7 +2608,9 @@
'<(SHARED_INTERMEDIATE_DIR)/chrome/browser/ui/webui/omnibox/omnibox.mojom.cc',
],
'dependencies': [
'browser/extensions/api/api_registration.gyp:chrome_api_registration',
'chrome_web_ui_mojo_bindings.gyp:web_ui_mojo_bindings',
'common/extensions/api/api.gyp:chrome_api',
'debugger',
'installer_util',
'../components/components.gyp:autofill_content_risk_proto',
......@@ -2958,8 +2960,6 @@
['enable_extensions==1', {
'dependencies': [
'browser_extensions',
'browser/extensions/api/api_registration.gyp:chrome_api_registration',
'common/extensions/api/api.gyp:chrome_api',
],
'sources': [ '<@(chrome_browser_ui_extensions_sources)' ],
}],
......
......@@ -53,14 +53,30 @@
'common/custom_handlers/protocol_handler.cc',
'common/custom_handlers/protocol_handler.h',
'common/descriptors_android.h',
'common/extensions/api/extension_action/action_info.cc',
'common/extensions/api/extension_action/action_info.h',
'common/extensions/api/i18n/default_locale_handler.cc',
'common/extensions/api/i18n/default_locale_handler.h',
'common/extensions/api/identity/oauth2_manifest_handler.cc',
'common/extensions/api/identity/oauth2_manifest_handler.h',
'common/extensions/api/plugins/plugins_handler.cc',
'common/extensions/api/plugins/plugins_handler.h',
'common/extensions/api/storage/storage_schema_manifest_handler.cc',
'common/extensions/api/storage/storage_schema_manifest_handler.h',
'common/extensions/api/supervised_user_private/supervised_user_handler.cc',
'common/extensions/api/supervised_user_private/supervised_user_handler.h',
'common/extensions/chrome_extension_messages.h',
'common/extensions/chrome_extensions_client.cc',
'common/extensions/chrome_extensions_client.h',
'common/extensions/chrome_manifest_handlers.cc',
'common/extensions/chrome_manifest_handlers.h',
'common/extensions/chrome_utility_extensions_messages.h',
'common/extensions/command.cc',
'common/extensions/command.h',
'common/extensions/extension_constants.cc',
'common/extensions/extension_constants.h',
'common/extensions/extension_file_util.cc',
'common/extensions/extension_file_util.h',
'common/extensions/extension_process_policy.cc',
'common/extensions/extension_process_policy.h',
'common/extensions/features/chrome_channel_feature_filter.cc',
......@@ -69,6 +85,28 @@
'common/extensions/features/feature_channel.h',
'common/extensions/image_writer/image_writer_util_mac.cc',
'common/extensions/image_writer/image_writer_util_mac.h',
'common/extensions/manifest_handlers/app_isolation_info.cc',
'common/extensions/manifest_handlers/app_isolation_info.h',
'common/extensions/manifest_handlers/app_launch_info.cc',
'common/extensions/manifest_handlers/app_launch_info.h',
'common/extensions/manifest_handlers/automation.h',
'common/extensions/manifest_handlers/automation.cc',
'common/extensions/manifest_handlers/content_scripts_handler.cc',
'common/extensions/manifest_handlers/content_scripts_handler.h',
'common/extensions/manifest_handlers/mime_types_handler.cc',
'common/extensions/manifest_handlers/mime_types_handler.h',
'common/extensions/manifest_handlers/minimum_chrome_version_checker.cc',
'common/extensions/manifest_handlers/minimum_chrome_version_checker.h',
'common/extensions/manifest_handlers/settings_overrides_handler.cc',
'common/extensions/manifest_handlers/settings_overrides_handler.h',
'common/extensions/manifest_handlers/synthesize_browser_action_handler.cc',
'common/extensions/manifest_handlers/synthesize_browser_action_handler.h',
'common/extensions/manifest_handlers/theme_handler.cc',
'common/extensions/manifest_handlers/theme_handler.h',
'common/extensions/manifest_handlers/ui_overrides_handler.cc',
'common/extensions/manifest_handlers/ui_overrides_handler.h',
'common/extensions/manifest_url_handler.cc',
'common/extensions/manifest_url_handler.h',
'common/extensions/permissions/chrome_api_permissions.cc',
'common/extensions/permissions/chrome_api_permissions.h',
'common/extensions/permissions/chrome_permission_message_provider.cc',
......@@ -150,66 +188,28 @@
'chrome_common_extensions_sources': [
'common/extensions/api/commands/commands_handler.cc',
'common/extensions/api/commands/commands_handler.h',
'common/extensions/api/extension_action/action_info.cc',
'common/extensions/api/extension_action/action_info.h',
'common/extensions/api/extension_action/browser_action_handler.cc',
'common/extensions/api/extension_action/browser_action_handler.h',
'common/extensions/api/extension_action/page_action_handler.cc',
'common/extensions/api/extension_action/page_action_handler.h',
'common/extensions/api/file_browser_handlers/file_browser_handler.cc',
'common/extensions/api/file_browser_handlers/file_browser_handler.h',
'common/extensions/api/i18n/default_locale_handler.cc',
'common/extensions/api/i18n/default_locale_handler.h',
'common/extensions/api/identity/oauth2_manifest_handler.cc',
'common/extensions/api/identity/oauth2_manifest_handler.h',
'common/extensions/api/input_ime/input_components_handler.cc',
'common/extensions/api/input_ime/input_components_handler.h',
'common/extensions/api/notifications/notification_style.cc',
'common/extensions/api/notifications/notification_style.h',
'common/extensions/api/omnibox/omnibox_handler.cc',
'common/extensions/api/omnibox/omnibox_handler.h',
'common/extensions/api/plugins/plugins_handler.cc',
'common/extensions/api/plugins/plugins_handler.h',
'common/extensions/api/speech/tts_engine_manifest_handler.cc',
'common/extensions/api/speech/tts_engine_manifest_handler.h',
'common/extensions/api/spellcheck/spellcheck_handler.cc',
'common/extensions/api/spellcheck/spellcheck_handler.h',
'common/extensions/api/storage/storage_schema_manifest_handler.cc',
'common/extensions/api/storage/storage_schema_manifest_handler.h',
'common/extensions/api/supervised_user_private/supervised_user_handler.cc',
'common/extensions/api/supervised_user_private/supervised_user_handler.h',
'common/extensions/api/system_indicator/system_indicator_handler.cc',
'common/extensions/api/system_indicator/system_indicator_handler.h',
'common/extensions/api/url_handlers/url_handlers_parser.cc',
'common/extensions/api/url_handlers/url_handlers_parser.h',
'common/extensions/api/webstore/webstore_api_constants.cc',
'common/extensions/api/webstore/webstore_api_constants.h',
'common/extensions/chrome_manifest_handlers.cc',
'common/extensions/chrome_manifest_handlers.h',
'common/extensions/extension_file_util.cc',
'common/extensions/extension_file_util.h',
'common/extensions/manifest_handlers/app_isolation_info.cc',
'common/extensions/manifest_handlers/app_isolation_info.h',
'common/extensions/manifest_handlers/app_launch_info.cc',
'common/extensions/manifest_handlers/app_launch_info.h',
'common/extensions/manifest_handlers/automation.cc',
'common/extensions/manifest_handlers/automation.h',
'common/extensions/manifest_handlers/content_scripts_handler.cc',
'common/extensions/manifest_handlers/content_scripts_handler.h',
'common/extensions/manifest_handlers/mime_types_handler.cc',
'common/extensions/manifest_handlers/mime_types_handler.h',
'common/extensions/manifest_handlers/minimum_chrome_version_checker.cc',
'common/extensions/manifest_handlers/minimum_chrome_version_checker.h',
'common/extensions/manifest_handlers/settings_overrides_handler.cc',
'common/extensions/manifest_handlers/settings_overrides_handler.h',
'common/extensions/manifest_handlers/synthesize_browser_action_handler.cc',
'common/extensions/manifest_handlers/synthesize_browser_action_handler.h',
'common/extensions/manifest_handlers/theme_handler.cc',
'common/extensions/manifest_handlers/theme_handler.h',
'common/extensions/manifest_handlers/ui_overrides_handler.cc',
'common/extensions/manifest_handlers/ui_overrides_handler.h',
'common/extensions/manifest_url_handler.cc',
'common/extensions/manifest_url_handler.h',
],
'chrome_common_full_safe_browsing_sources': [
'common/safe_browsing/download_protection_util.cc',
......@@ -336,8 +336,7 @@
['enable_extensions==1', {
'sources': [ '<@(chrome_common_extensions_sources)' ],
'dependencies': [
'<(DEPTH)/device/usb/usb.gyp:device_usb',
'<(DEPTH)/extensions/common/api/api.gyp:extensions_api',
'../device/usb/usb.gyp:device_usb',
],
}],
['OS=="win" or OS=="mac"', {
......@@ -362,6 +361,7 @@
'<(DEPTH)/components/components.gyp:signin_core_common',
'<(DEPTH)/components/components.gyp:translate_content_common',
'<(DEPTH)/components/components.gyp:visitedlink_common',
'<(DEPTH)/extensions/common/api/api.gyp:extensions_api',
'<(DEPTH)/extensions/extensions.gyp:extensions_common',
'<(DEPTH)/ipc/ipc.gyp:ipc',
'<(DEPTH)/third_party/re2/re2.gyp:re2',
......
......@@ -1660,6 +1660,7 @@
'conditions': [
['OS!="ios"', {
'dependencies': [
'common/extensions/api/api.gyp:chrome_api',
'plugin',
'renderer',
'utility',
......@@ -1671,6 +1672,7 @@
'../components/components.gyp:autofill_core_test_support',
'../components/components.gyp:captive_portal_test_support',
'../components/components.gyp:sessions_test_support',
'../extensions/extensions.gyp:extensions_test_support',
'../google_apis/google_apis.gyp:google_apis_test_support',
'../ipc/ipc.gyp:test_support_ipc',
'../media/media.gyp:media_test_support',
......@@ -1784,8 +1786,6 @@
['enable_extensions==1', {
'dependencies': [
'../components/components.gyp:storage_monitor_test_support',
'../extensions/extensions.gyp:extensions_test_support',
'common/extensions/api/api.gyp:chrome_api',
],
'sources': [
'browser/drive/dummy_drive_service.cc',
......@@ -1965,11 +1965,14 @@
'conditions': [
['OS!="ios"', {
'dependencies': [
'common/extensions/api/api.gyp:chrome_api',
'../components/components.gyp:autofill_content_test_support',
'../components/components.gyp:component_metrics_proto',
'../components/components.gyp:data_reduction_proxy_test_support',
'../components/components_strings.gyp:components_strings',
'../content/app/resources/content_resources.gyp:content_resources',
'../extensions/extensions_resources.gyp:extensions_resources',
'../extensions/extensions_strings.gyp:extensions_strings',
'../gpu/gpu.gyp:gpu_unittest_utils',
'../media/media.gyp:media_test_support',
'../ppapi/ppapi_internal.gyp:ppapi_unittest_shared',
......@@ -2054,7 +2057,11 @@
['exclude', '^browser/extensions/'],
['exclude', '^browser/sync/glue/extensions_activity_monitor_unittest.cc'],
['exclude', '^browser/sync_file_system/'],
['exclude', '^common/extensions/'],
['exclude', '^common/extensions/api/'],
['exclude', '^common/extensions/manifest_handlers/'],
['exclude', '^common/extensions/manifest_tests/'],
# This test depends on manifest_tests.
['exclude', '^common/extensions/permissions/settings_override_permission_unittest.cc'],
['exclude', '^utility/extensions/'],
['exclude', '^utility/image_writer/'],
['exclude', '^utility/media_galleries/'],
......@@ -2087,12 +2094,6 @@
'renderer/extensions/extension_localization_peer_unittest.cc',
'renderer/extensions/renderer_permissions_policy_delegate_unittest.cc',
],
}, { # enable_extensions==1
'dependencies': [
'common/extensions/api/api.gyp:chrome_api',
'../extensions/extensions_resources.gyp:extensions_resources',
'../extensions/extensions_strings.gyp:extensions_strings',
],
}],
['use_ash==1', {
'sources': [
......
......@@ -100,7 +100,7 @@ static_library("common") {
gypi_values.chrome_common_extensions_sources,
".", "//chrome")
deps += [
"//device/bluetooth", # TODO(thestig) Still needed? Not in gyp version.
"//device/bluetooth",
"//device/usb",
"//extensions/common",
"//extensions/common/api",
......
......@@ -7,6 +7,13 @@
'<@(schema_files)',
],
'variables': {
# These duplicate other lists and are the only ones used on Android. They
# should be eliminated. See crbug.com/305852.
'android_schema_files': [
'manifest_types.json',
],
# These are used everywhere except Android.
'main_schema_files': [
'accessibility_private.json',
'activity_log_private.json',
......@@ -135,9 +142,6 @@
# Disable schema compiler to generate model extension API code.
# Only register the extension functions in extension system.
'conditions': [
# TODO(thestig): Remove this file from non-extensions build so the
# conditional and else branch goes away.
# Do the same for chrome/common/extensions/api/schemas.gni.
['enable_extensions==1', {
'non_compiled_schema_files': [
'<@(main_non_compiled_schema_files)',
......@@ -157,6 +161,8 @@
'schema_dependencies': [
],
'schema_files': [
# These should be eliminated. See crbug.com/305852.
'<@(android_schema_files)',
],
}],
['chromeos==1', {
......
......@@ -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"
......@@ -17,6 +18,7 @@
#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"
......@@ -39,12 +41,8 @@
#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 {
......@@ -85,9 +83,7 @@ void ChromeExtensionsClient::Initialize() {
// thread runs in-process.
if (!ManifestHandler::IsRegistrationFinalized()) {
RegisterCommonManifestHandlers();
#if defined(ENABLE_EXTENSIONS)
RegisterChromeManifestHandlers();
#endif
ManifestHandler::FinalizeRegistration();
}
......@@ -234,26 +230,18 @@ 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(
......
......@@ -8,6 +8,10 @@
],
'variables': {
'chromium_code': 1,
# TODO: Eliminate these on Android. See crbug.com/305852.
'android_schema_files': [
'runtime.json',
],
'main_schema_files': [
'app_current_window_internal.idl',
'app_runtime.idl',
......@@ -46,9 +50,6 @@
],
'non_compiled_schema_files': [
],
# TODO(thestig) Do not include this file in non-extensions builds.
# Then the conditional and else block can go away.
# Do the same for extensions/common/api/schemas.gni.
'conditions': [
['enable_extensions==1', {
'schema_files': [
......@@ -56,6 +57,7 @@
],
}, {
'schema_files': [
'<@(android_schema_files)',
],
}],
],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment