Commit 379f0be4 authored by thestig's avatar thestig Committed by Commit bot

Cleanup: Remove remaining generated extensions APIs on Android.

BUG=305852

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

Cr-Commit-Position: refs/heads/master@{#295669}
parent ec19e508
......@@ -32,11 +32,14 @@
#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"
#include "testing/gtest/include/gtest/gtest.h"
#endif
using base::ASCIIToUTF16;
......@@ -819,6 +822,7 @@ 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"));
......@@ -847,3 +851,4 @@ TEST_F(ShortcutsProviderTest, Extension) {
// Now the URL should have disappeared.
RunTest(text, false, ExpectedURLs(), std::string(), base::string16());
}
#endif
......@@ -9,9 +9,12 @@
#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 "extensions/common/value_builder.h"
#include "policy/policy_constants.h"
#if defined(ENABLE_EXTENSIONS)
#include "extensions/common/value_builder.h"
#endif
namespace policy {
class ManagedBookmarksPolicyHandlerTest
......@@ -23,6 +26,7 @@ class ManagedBookmarksPolicyHandlerTest
}
};
#if defined(ENABLE_EXTENSIONS)
TEST_F(ManagedBookmarksPolicyHandlerTest, ApplyPolicySettings) {
EXPECT_FALSE(store_->GetValue(bookmarks::prefs::kManagedBookmarks, NULL));
......@@ -101,6 +105,7 @@ TEST_F(ManagedBookmarksPolicyHandlerTest, ApplyPolicySettings) {
.Build());
EXPECT_TRUE(pref_value->Equals(expected.get()));
}
#endif // defined(ENABLE_EXTENSIONS)
TEST_F(ManagedBookmarksPolicyHandlerTest, WrongPolicyType) {
PolicyMap policy;
......@@ -121,6 +126,7 @@ 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,
......@@ -149,7 +155,9 @@ 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,
......@@ -189,5 +197,6 @@ TEST_F(ManagedBookmarksPolicyHandlerTest, BadBookmark) {
.Build());
EXPECT_TRUE(pref_value->Equals(expected.get()));
}
#endif
} // namespace policy
......@@ -2885,8 +2885,6 @@
['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',
......@@ -3012,6 +3010,8 @@
['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,9 +2608,7 @@
'<(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',
......@@ -2960,6 +2958,8 @@
['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,30 +53,14 @@
'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',
......@@ -85,28 +69,6 @@
'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',
......@@ -188,28 +150,66 @@
'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,7 +336,8 @@
['enable_extensions==1', {
'sources': [ '<@(chrome_common_extensions_sources)' ],
'dependencies': [
'../device/usb/usb.gyp:device_usb',
'<(DEPTH)/device/usb/usb.gyp:device_usb',
'<(DEPTH)/extensions/common/api/api.gyp:extensions_api',
],
}],
['OS=="win" or OS=="mac"', {
......@@ -361,7 +362,6 @@
'<(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,7 +1660,6 @@
'conditions': [
['OS!="ios"', {
'dependencies': [
'common/extensions/api/api.gyp:chrome_api',
'plugin',
'renderer',
'utility',
......@@ -1672,7 +1671,6 @@
'../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',
......@@ -1786,6 +1784,8 @@
['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,14 +1965,11 @@
'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',
......@@ -2057,11 +2054,7 @@
['exclude', '^browser/extensions/'],
['exclude', '^browser/sync/glue/extensions_activity_monitor_unittest.cc'],
['exclude', '^browser/sync_file_system/'],
['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', '^common/extensions/'],
['exclude', '^utility/extensions/'],
['exclude', '^utility/image_writer/'],
['exclude', '^utility/media_galleries/'],
......@@ -2094,6 +2087,12 @@
'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",
"//device/bluetooth", # TODO(thestig) Still needed? Not in gyp version.
"//device/usb",
"//extensions/common",
"//extensions/common/api",
......
......@@ -7,13 +7,6 @@
'<@(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',
......@@ -142,6 +135,9 @@
# 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)',
......@@ -161,8 +157,6 @@
'schema_dependencies': [
],
'schema_files': [
# These should be eliminated. See crbug.com/305852.
'<@(android_schema_files)',
],
}],
['chromeos==1', {
......
......@@ -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(
......
......@@ -8,10 +8,6 @@
],
'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',
......@@ -50,6 +46,9 @@
],
'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': [
......@@ -57,7 +56,6 @@
],
}, {
'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