| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 5 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/incognito_helpers.h" | 7 #include "chrome/browser/profiles/incognito_helpers.h" |
| 8 #include "chrome/browser/spellchecker/spellcheck_service.h" | 8 #include "chrome/browser/spellchecker/spellcheck_service.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/grit/locale_settings.h" | 10 #include "chrome/grit/locale_settings.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void SpellcheckServiceFactory::RegisterProfilePrefs( | 69 void SpellcheckServiceFactory::RegisterProfilePrefs( |
| 70 user_prefs::PrefRegistrySyncable* user_prefs) { | 70 user_prefs::PrefRegistrySyncable* user_prefs) { |
| 71 user_prefs->RegisterListPref(prefs::kSpellCheckDictionaries, | 71 user_prefs->RegisterListPref(prefs::kSpellCheckDictionaries, |
| 72 new base::ListValue); | 72 new base::ListValue); |
| 73 // Continue registering kSpellCheckDictionary for preference migration. | 73 // Continue registering kSpellCheckDictionary for preference migration. |
| 74 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. | 74 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |
| 75 user_prefs->RegisterStringPref( | 75 user_prefs->RegisterStringPref( |
| 76 prefs::kSpellCheckDictionary, | 76 prefs::kSpellCheckDictionary, |
| 77 l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY)); | 77 l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY)); |
| 78 user_prefs->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, false); | 78 user_prefs->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, false); |
| 79 user_prefs->RegisterBooleanPref( | 79 #if defined(OS_IOS) || defined(OS_ANDROID) |
| 80 prefs::kEnableContinuousSpellcheck, | 80 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; |
| 81 true, | 81 #else |
| 82 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 82 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; |
| 83 #endif |
| 84 user_prefs->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, true, |
| 85 flags); |
| 83 } | 86 } |
| 84 | 87 |
| 85 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( | 88 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( |
| 86 content::BrowserContext* context) const { | 89 content::BrowserContext* context) const { |
| 87 return chrome::GetBrowserContextRedirectedInIncognito(context); | 90 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 88 } | 91 } |
| 89 | 92 |
| 90 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { | 93 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { |
| 91 return true; | 94 return true; |
| 92 } | 95 } |
| OLD | NEW |