From 03824ef53f677033cbc86c7791a8e817b40d06de Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Sat, 30 Nov 2019 23:17:46 +0100 Subject: [PATCH] build: fix building with enable_builtin_spellchecker = false (#21334) --- BUILD.gn | 5 +- chromium_src/BUILD.gn | 74 +++++++++++++++------------ shell/browser/api/atom_api_session.cc | 6 +-- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index f3b0549de218..96cc73b93c42 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -354,6 +354,7 @@ source_set("electron_lib") { ":resources", "buildflags", "chromium_src:chrome", + "chromium_src:chrome_spellchecker", "native_mate", "shell/common/api:mojo", "//base:base_static", @@ -482,10 +483,6 @@ source_set("electron_lib") { ] } - if (enable_builtin_spellchecker) { - deps += [ "chromium_src:chrome_spellchecker" ] - } - if (is_mac) { deps += [ "//components/remote_cocoa/app_shim", diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 41ef5d718868..51767228f4ed 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -308,45 +308,51 @@ source_set("plugins") { # You may have to add new files here during the upgrade if //chrome/browser/spellchecker # gets more files source_set("chrome_spellchecker") { - sources = [ - "//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc", - "//chrome/browser/spellchecker/spell_check_host_chrome_impl.h", - "//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc", - "//chrome/browser/spellchecker/spellcheck_custom_dictionary.h", - "//chrome/browser/spellchecker/spellcheck_factory.cc", - "//chrome/browser/spellchecker/spellcheck_factory.h", - "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc", - "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h", - "//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.cc", - "//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.h", - "//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc", - "//chrome/browser/spellchecker/spellcheck_language_policy_handler.h", - "//chrome/browser/spellchecker/spellcheck_service.cc", - "//chrome/browser/spellchecker/spellcheck_service.h", - "//chrome/common/pref_names.h", - ] + sources = [] + deps = [] + libs = [] - if (has_spellcheck_panel) { + if (enable_builtin_spellchecker) { sources += [ - "//chrome/browser/spellchecker/spell_check_panel_host_impl.cc", - "//chrome/browser/spellchecker/spell_check_panel_host_impl.h", + "//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc", + "//chrome/browser/spellchecker/spell_check_host_chrome_impl.h", + "//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc", + "//chrome/browser/spellchecker/spellcheck_custom_dictionary.h", + "//chrome/browser/spellchecker/spellcheck_factory.cc", + "//chrome/browser/spellchecker/spellcheck_factory.h", + "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc", + "//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h", + "//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.cc", + "//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.h", + "//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc", + "//chrome/browser/spellchecker/spellcheck_language_policy_handler.h", + "//chrome/browser/spellchecker/spellcheck_service.cc", + "//chrome/browser/spellchecker/spellcheck_service.h", + "//chrome/common/pref_names.h", + ] + + if (has_spellcheck_panel) { + sources += [ + "//chrome/browser/spellchecker/spell_check_panel_host_impl.cc", + "//chrome/browser/spellchecker/spell_check_panel_host_impl.h", + ] + } + + if (use_browser_spellchecker) { + sources += [ + "//chrome/browser/spellchecker/spelling_request.cc", + "//chrome/browser/spellchecker/spelling_request.h", + ] + } + + deps += [ + "//base:base_static", + "//components/language/core/browser", + "//components/spellcheck:buildflags", + "//components/sync", ] } - if (use_browser_spellchecker) { - sources += [ - "//chrome/browser/spellchecker/spelling_request.cc", - "//chrome/browser/spellchecker/spelling_request.h", - ] - } - - deps = [ - "//base:base_static", - "//components/language/core/browser", - "//components/spellcheck:buildflags", - "//components/sync", - ] - public_deps = [ "//components/spellcheck/browser", "//components/spellcheck/common", diff --git a/shell/browser/api/atom_api_session.cc b/shell/browser/api/atom_api_session.cc index d4e8389abf9d..2ee2ed4cd6c9 100644 --- a/shell/browser/api/atom_api_session.cc +++ b/shell/browser/api/atom_api_session.cc @@ -69,9 +69,9 @@ #endif #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) -#include "chrome/browser/spellchecker/spellcheck_factory.h" -#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" -#include "chrome/browser/spellchecker/spellcheck_service.h" +#include "chrome/browser/spellchecker/spellcheck_factory.h" // nogncheck +#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" // nogncheck +#include "chrome/browser/spellchecker/spellcheck_service.h" // nogncheck #include "components/spellcheck/browser/pref_names.h" #include "components/spellcheck/common/spellcheck_common.h"