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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/incognito_helpers.h" | 8 #include "chrome/browser/profiles/incognito_helpers.h" |
9 #include "chrome/browser/spellchecker/spellcheck_service.h" | 9 #include "chrome/browser/spellchecker/spellcheck_service.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 prefs->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 64 prefs->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
65 | 65 |
66 return spellcheck; | 66 return spellcheck; |
67 } | 67 } |
68 | 68 |
69 void SpellcheckServiceFactory::RegisterProfilePrefs( | 69 void SpellcheckServiceFactory::RegisterProfilePrefs( |
70 user_prefs::PrefRegistrySyncable* user_prefs) { | 70 user_prefs::PrefRegistrySyncable* user_prefs) { |
71 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. | 71 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |
72 user_prefs->RegisterStringPref( | 72 user_prefs->RegisterStringPref( |
73 prefs::kSpellCheckDictionary, | 73 prefs::kSpellCheckDictionary, |
74 l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY), | 74 l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY)); |
75 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 75 user_prefs->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, false); |
76 user_prefs->RegisterBooleanPref( | |
77 prefs::kSpellCheckUseSpellingService, | |
78 false, | |
79 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
80 user_prefs->RegisterBooleanPref( | 76 user_prefs->RegisterBooleanPref( |
81 prefs::kEnableContinuousSpellcheck, | 77 prefs::kEnableContinuousSpellcheck, |
82 true, | 78 true, |
83 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 79 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
84 user_prefs->RegisterBooleanPref( | 80 user_prefs->RegisterBooleanPref( |
85 prefs::kEnableAutoSpellCorrect, | 81 prefs::kEnableAutoSpellCorrect, |
86 false, | 82 false, |
87 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 83 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
88 } | 84 } |
89 | 85 |
90 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( | 86 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( |
91 content::BrowserContext* context) const { | 87 content::BrowserContext* context) const { |
92 return chrome::GetBrowserContextRedirectedInIncognito(context); | 88 return chrome::GetBrowserContextRedirectedInIncognito(context); |
93 } | 89 } |
94 | 90 |
95 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { | 91 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { |
96 return true; | 92 return true; |
97 } | 93 } |
OLD | NEW |