summaryrefslogtreecommitdiff
path: root/chromium/components/spellcheck/browser
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/spellcheck/browser
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/spellcheck/browser')
-rw-r--r--chromium/components/spellcheck/browser/spell_check_host_impl.cc9
-rw-r--r--chromium/components/spellcheck/browser/spell_check_host_impl.h9
-rw-r--r--chromium/components/spellcheck/browser/spellcheck_platform.h12
-rw-r--r--chromium/components/spellcheck/browser/spellcheck_platform_win.cc4
-rw-r--r--chromium/components/spellcheck/browser/windows_spell_checker.cc1
-rw-r--r--chromium/components/spellcheck/browser/windows_spell_checker_unittest.cc14
6 files changed, 19 insertions, 30 deletions
diff --git a/chromium/components/spellcheck/browser/spell_check_host_impl.cc b/chromium/components/spellcheck/browser/spell_check_host_impl.cc
index 0d600fa9d0b..d585f5d2ae5 100644
--- a/chromium/components/spellcheck/browser/spell_check_host_impl.cc
+++ b/chromium/components/spellcheck/browser/spell_check_host_impl.cc
@@ -67,10 +67,8 @@ void SpellCheckHostImpl::FillSuggestionList(
NOTREACHED();
std::move(callback).Run({});
}
-#endif // BUILDFLAG(USE_BROWSER_SPELLCHECKER) &&
- // !BUILDFLAG(ENABLE_SPELLING_SERVICE)
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#if defined(OS_WIN)
void SpellCheckHostImpl::GetPerLanguageSuggestions(
const base::string16& word,
GetPerLanguageSuggestionsCallback callback) {
@@ -79,7 +77,10 @@ void SpellCheckHostImpl::GetPerLanguageSuggestions(
// This API requires Chrome-only features.
std::move(callback).Run(std::vector<std::vector<base::string16>>());
}
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#endif // defined(OS_WIN)
+
+#endif // BUILDFLAG(USE_BROWSER_SPELLCHECKER) &&
+ // !BUILDFLAG(ENABLE_SPELLING_SERVICE)
#if defined(OS_ANDROID)
void SpellCheckHostImpl::DisconnectSessionBridge() {
diff --git a/chromium/components/spellcheck/browser/spell_check_host_impl.h b/chromium/components/spellcheck/browser/spell_check_host_impl.h
index 0e847af45a7..efade8ac2bf 100644
--- a/chromium/components/spellcheck/browser/spell_check_host_impl.h
+++ b/chromium/components/spellcheck/browser/spell_check_host_impl.h
@@ -50,14 +50,15 @@ class SpellCheckHostImpl : public spellcheck::mojom::SpellCheckHost {
CheckSpellingCallback callback) override;
void FillSuggestionList(const base::string16& word,
FillSuggestionListCallback callback) override;
-#endif // BUILDFLAG(USE_BROWSER_SPELLCHECKER) &&
- // !BUILDFLAG(ENABLE_SPELLING_SERVICE)
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#if defined(OS_WIN)
void GetPerLanguageSuggestions(
const base::string16& word,
GetPerLanguageSuggestionsCallback callback) override;
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#endif // defined(OS_WIN)
+
+#endif // BUILDFLAG(USE_BROWSER_SPELLCHECKER) &&
+ // !BUILDFLAG(ENABLE_SPELLING_SERVICE)
#if defined(OS_ANDROID)
// spellcheck::mojom::SpellCheckHost:
diff --git a/chromium/components/spellcheck/browser/spellcheck_platform.h b/chromium/components/spellcheck/browser/spellcheck_platform.h
index ad11d9e34e9..be1e5e7f32a 100644
--- a/chromium/components/spellcheck/browser/spellcheck_platform.h
+++ b/chromium/components/spellcheck/browser/spellcheck_platform.h
@@ -20,9 +20,9 @@
#include "components/spellcheck/browser/spellcheck_host_metrics.h"
#endif // defined(OS_WIN)
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#if defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
#include "components/spellcheck/common/spellcheck_common.h"
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#endif // defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
class PlatformSpellChecker;
@@ -33,10 +33,10 @@ namespace spellcheck_platform {
typedef base::OnceCallback<void(const std::vector<SpellCheckResult>&)>
TextCheckCompleteCallback;
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#if defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
typedef base::OnceCallback<void(const spellcheck::PerLanguageSuggestions&)>
GetSuggestionsCallback;
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#endif // defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
typedef base::OnceCallback<void(const std::vector<std::string>& /* results */)>
RetrieveSpellcheckLanguagesCompleteCallback;
@@ -135,12 +135,12 @@ void RequestTextCheck(PlatformSpellChecker* spell_checker_instance,
const base::string16& text,
TextCheckCompleteCallback callback);
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#if defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
// Finds the replacement suggestions for each language for the given word.
void GetPerLanguageSuggestions(PlatformSpellChecker* spell_checker_instance,
const base::string16& word,
GetSuggestionsCallback callback);
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#endif // defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
#if defined(OS_WIN)
// Records statistics about spell check support for the user's Chrome locales.
diff --git a/chromium/components/spellcheck/browser/spellcheck_platform_win.cc b/chromium/components/spellcheck/browser/spellcheck_platform_win.cc
index 1cc03aef4f8..8e66c3ca1bc 100644
--- a/chromium/components/spellcheck/browser/spellcheck_platform_win.cc
+++ b/chromium/components/spellcheck/browser/spellcheck_platform_win.cc
@@ -61,14 +61,14 @@ void RequestTextCheck(PlatformSpellChecker* spell_checker_instance,
->RequestTextCheck(document_tag, text, std::move(callback));
}
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#if defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
void GetPerLanguageSuggestions(PlatformSpellChecker* spell_checker_instance,
const base::string16& word,
GetSuggestionsCallback callback) {
reinterpret_cast<WindowsSpellChecker*>(spell_checker_instance)
->GetPerLanguageSuggestions(word, std::move(callback));
}
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
+#endif // defined(OS_WIN) && BUILDFLAG(USE_BROWSER_SPELLCHECKER)
void AddWord(PlatformSpellChecker* spell_checker_instance,
const base::string16& word) {
diff --git a/chromium/components/spellcheck/browser/windows_spell_checker.cc b/chromium/components/spellcheck/browser/windows_spell_checker.cc
index e27ac54526f..ec32eb49206 100644
--- a/chromium/components/spellcheck/browser/windows_spell_checker.cc
+++ b/chromium/components/spellcheck/browser/windows_spell_checker.cc
@@ -19,6 +19,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
diff --git a/chromium/components/spellcheck/browser/windows_spell_checker_unittest.cc b/chromium/components/spellcheck/browser/windows_spell_checker_unittest.cc
index df5731d6717..75a2c2db691 100644
--- a/chromium/components/spellcheck/browser/windows_spell_checker_unittest.cc
+++ b/chromium/components/spellcheck/browser/windows_spell_checker_unittest.cc
@@ -31,15 +31,7 @@ namespace {
class WindowsSpellCheckerTest : public testing::Test {
public:
WindowsSpellCheckerTest() {
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
- // Force hybrid spellchecking to be enabled.
- feature_list_.InitWithFeatures(
- /*enabled_features=*/{spellcheck::kWinUseBrowserSpellChecker,
- spellcheck::kWinUseHybridSpellChecker},
- /*disabled_features=*/{});
-#else
feature_list_.InitAndEnableFeature(spellcheck::kWinUseBrowserSpellChecker);
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
// The WindowsSpellchecker object can be created even on Windows versions
// that don't support platform spellchecking. However, the spellcheck
@@ -82,7 +74,6 @@ class WindowsSpellCheckerTest : public testing::Test {
std::move(quit_).Run();
}
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
void PerLanguageSuggestionsCompletionCallback(
const spellcheck::PerLanguageSuggestions& suggestions) {
callback_finished_ = true;
@@ -90,7 +81,6 @@ class WindowsSpellCheckerTest : public testing::Test {
if (quit_)
std::move(quit_).Run();
}
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
void RetrieveSpellcheckLanguagesCompletionCallback(
const std::vector<std::string>& spellcheck_languages) {
@@ -112,9 +102,7 @@ class WindowsSpellCheckerTest : public testing::Test {
bool set_language_result_;
std::vector<SpellCheckResult> spell_check_results_;
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
spellcheck::PerLanguageSuggestions per_language_suggestions_;
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
std::vector<std::string> spellcheck_languages_;
base::test::TaskEnvironment task_environment_{
@@ -217,7 +205,6 @@ TEST_F(WindowsSpellCheckerTest, RetrieveSpellcheckLanguagesFakeDictionaries) {
ASSERT_EQ(spellcheck_languages_for_testing, spellcheck_languages_);
}
-#if BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
TEST_F(WindowsSpellCheckerTest, GetPerLanguageSuggestions) {
ASSERT_EQ(set_language_result_,
spellcheck::WindowsVersionSupportsSpellchecker());
@@ -239,6 +226,5 @@ TEST_F(WindowsSpellCheckerTest, GetPerLanguageSuggestions) {
ASSERT_EQ(per_language_suggestions_.size(), 1u);
ASSERT_GT(per_language_suggestions_[0].size(), 0u);
}
-#endif // BUILDFLAG(USE_WIN_HYBRID_SPELLCHECKER)
} // namespace