summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-06-12 15:29:10 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-06-14 10:03:53 +0000
commitbb3f7ba2f6d10abde885904eea8bca9bee8554d6 (patch)
tree2de1d99d0d4c7318cc42e08320da1ddf65bc8566 /src/core
parent324ab7bd0cecd462bd19523bc07b6a73b749e014 (diff)
Fix preferences references
We were using the wrong spellcheck preferences, they have moved to the spellcheck component. It mostly worked because their internal names had stayed the same. Change-Id: I485b11d88ee9c6e13d9c2b769c271d27bee4ba30 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/browser_context_qt.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp
index 133006d70..ffee001ff 100644
--- a/src/core/browser_context_qt.cpp
+++ b/src/core/browser_context_qt.cpp
@@ -63,8 +63,9 @@
#include "components/prefs/pref_registry_simple.h"
#include "components/user_prefs/user_prefs.h"
#if BUILDFLAG(ENABLE_SPELLCHECK)
-#include "chrome/common/pref_names.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
+#include "chrome/common/pref_names.h"
+#include "components/spellcheck/browser/pref_names.h"
#endif
namespace QtWebEngineCore {
@@ -80,12 +81,11 @@ BrowserContextQt::BrowserContextQt(BrowserContextAdapter *adapter)
#if BUILDFLAG(ENABLE_SPELLCHECK)
// Initial spellcheck settings
- registry->RegisterListPref(prefs::kSpellCheckDictionaries, new base::ListValue());
registry->RegisterStringPref(prefs::kAcceptLanguages, std::string());
- registry->RegisterStringPref(prefs::kSpellCheckDictionary, std::string());
- registry->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, false);
- registry->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, false);
- registry->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, false);
+ registry->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries, new base::ListValue());
+ registry->RegisterStringPref(spellcheck::prefs::kSpellCheckDictionary, std::string());
+ registry->RegisterBooleanPref(spellcheck::prefs::kEnableSpellcheck, false);
+ registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckUseSpellingService, false);
#endif //ENABLE_SPELLCHECK
m_prefService = factory.Create(std::move(registry.get()));
user_prefs::UserPrefs::Set(this, m_prefService.get());
@@ -216,7 +216,7 @@ void BrowserContextQt::failedToLoadDictionary(const std::string &language)
void BrowserContextQt::setSpellCheckLanguages(const QStringList &languages)
{
StringListPrefMember dictionaries_pref;
- dictionaries_pref.Init(prefs::kSpellCheckDictionaries, m_prefService.get());
+ dictionaries_pref.Init(spellcheck::prefs::kSpellCheckDictionaries, m_prefService.get());
std::vector<std::string> dictionaries;
dictionaries.reserve(languages.size());
for (const auto &language : languages)
@@ -227,7 +227,7 @@ void BrowserContextQt::setSpellCheckLanguages(const QStringList &languages)
QStringList BrowserContextQt::spellCheckLanguages() const
{
QStringList spellcheck_dictionaries;
- for (const auto &value : *m_prefService->GetList(prefs::kSpellCheckDictionaries)) {
+ for (const auto &value : *m_prefService->GetList(spellcheck::prefs::kSpellCheckDictionaries)) {
std::string dictionary;
if (value->GetAsString(&dictionary))
spellcheck_dictionaries.append(QString::fromStdString(dictionary));
@@ -238,12 +238,12 @@ QStringList BrowserContextQt::spellCheckLanguages() const
void BrowserContextQt::setSpellCheckEnabled(bool enabled)
{
- m_prefService->SetBoolean(prefs::kEnableContinuousSpellcheck, enabled);
+ m_prefService->SetBoolean(spellcheck::prefs::kEnableSpellcheck, enabled);
}
bool BrowserContextQt::isSpellCheckEnabled() const
{
- return m_prefService->GetBoolean(prefs::kEnableContinuousSpellcheck);
+ return m_prefService->GetBoolean(spellcheck::prefs::kEnableSpellcheck);
}
#endif //ENABLE_SPELLCHECK
} // namespace QtWebEngineCore