Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7072)

Unified Diff: chrome/browser/spellchecker/spellcheck_factory.cc

Issue 1156473007: Enables the user to select multiple languages for spellchecking (UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments, added browsertest, fixed failures. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/spellchecker/spellcheck_factory.cc
diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
index edbed4055410f4b5c9027f3023dea245aa2fd68d..dc0b85d87c52d5d7e4c23e41c38c4f0b5080278e 100644
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
+++ b/chrome/browser/spellchecker/spellcheck_factory.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/spellcheck_common.h"
#include "chrome/grit/locale_settings.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -55,23 +56,33 @@ KeyedService* SpellcheckServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
// Many variables are initialized from the |context| in the SpellcheckService.
SpellcheckService* spellcheck = new SpellcheckService(context);
-
please use gerrit instead 2015/06/16 00:31:16 These whitespace changes or not necessary.
Julius 2015/06/17 00:59:52 Done.
PrefService* prefs = user_prefs::UserPrefs::Get(context);
DCHECK(prefs);
// Instantiates Metrics object for spellchecking for use.
spellcheck->StartRecordingMetrics(
prefs->GetBoolean(prefs::kEnableContinuousSpellcheck));
-
return spellcheck;
}
void SpellcheckServiceFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* user_prefs) {
// TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string.
+
+ // TODO(juliusa): Implement preference migration between multilingual
+ // spellchecking and single-language spellchecking.
please use gerrit instead 2015/06/16 00:31:16 You can put this on your own todo list, but let's
Julius 2015/06/17 00:59:52 Done.
+ if (chrome::spellcheck_common::MultilingualSpellcheckIsEnabled()) {
+ user_prefs->RegisterStringPref(
+ prefs::kSpellCheckDictionaries,
+ l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY),
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ } else {
please use gerrit instead 2015/06/16 00:31:16 Is that an empty else{} block?
Julius 2015/06/17 00:59:52 Done.
+ }
user_prefs->RegisterStringPref(
- prefs::kSpellCheckDictionary,
- l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY));
+ prefs::kSpellCheckDictionary,
+ l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY),
+ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+
user_prefs->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, false);
user_prefs->RegisterBooleanPref(
prefs::kEnableContinuousSpellcheck,

Powered by Google App Engine
This is Rietveld 408576698