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/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_dependency_manager.h" | 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 DCHECK(profile); | 38 DCHECK(profile); |
39 SpellcheckService* spellcheck = new SpellcheckService(profile); | 39 SpellcheckService* spellcheck = new SpellcheckService(profile); |
40 | 40 |
41 // Instantiates Metrics object for spellchecking for use. | 41 // Instantiates Metrics object for spellchecking for use. |
42 spellcheck->StartRecordingMetrics( | 42 spellcheck->StartRecordingMetrics( |
43 profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 43 profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
44 | 44 |
45 return spellcheck; | 45 return spellcheck; |
46 } | 46 } |
47 | 47 |
48 void SpellcheckServiceFactory::RegisterUserPrefs(PrefService* user_prefs) { | 48 void SpellcheckServiceFactory::RegisterUserPrefs( |
| 49 PrefServiceSyncable* user_prefs) { |
49 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. | 50 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |
50 user_prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, | 51 user_prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, |
51 IDS_SPELLCHECK_DICTIONARY, | 52 IDS_SPELLCHECK_DICTIONARY, |
52 PrefService::UNSYNCABLE_PREF); | 53 PrefServiceSyncable::UNSYNCABLE_PREF); |
53 user_prefs->RegisterBooleanPref(prefs::kSpellCheckConfirmDialogShown, | 54 user_prefs->RegisterBooleanPref(prefs::kSpellCheckConfirmDialogShown, |
54 false, | 55 false, |
55 PrefService::UNSYNCABLE_PREF); | 56 PrefServiceSyncable::UNSYNCABLE_PREF); |
56 user_prefs->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, | 57 user_prefs->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, |
57 false, | 58 false, |
58 PrefService::UNSYNCABLE_PREF); | 59 PrefServiceSyncable::UNSYNCABLE_PREF); |
59 user_prefs->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, | 60 user_prefs->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, |
60 true, | 61 true, |
61 PrefService::SYNCABLE_PREF); | 62 PrefServiceSyncable::SYNCABLE_PREF); |
62 user_prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, | 63 user_prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, |
63 true, | 64 true, |
64 PrefService::UNSYNCABLE_PREF); | 65 PrefServiceSyncable::UNSYNCABLE_PREF); |
65 } | 66 } |
66 | 67 |
67 bool SpellcheckServiceFactory::ServiceRedirectedInIncognito() const { | 68 bool SpellcheckServiceFactory::ServiceRedirectedInIncognito() const { |
68 return true; | 69 return true; |
69 } | 70 } |
70 | 71 |
71 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { | 72 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { |
72 return true; | 73 return true; |
73 } | 74 } |
OLD | NEW |