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