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/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 DCHECK(profile); | 64 DCHECK(profile); |
65 SpellcheckService* spellcheck = new SpellcheckService(profile); | 65 SpellcheckService* spellcheck = new SpellcheckService(profile); |
66 | 66 |
67 // Instantiates Metrics object for spellchecking for use. | 67 // Instantiates Metrics object for spellchecking for use. |
68 spellcheck->StartRecordingMetrics( | 68 spellcheck->StartRecordingMetrics( |
69 profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 69 profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
70 | 70 |
71 return spellcheck; | 71 return spellcheck; |
72 } | 72 } |
73 | 73 |
74 void SpellcheckServiceFactory::RegisterUserPrefs( | 74 void SpellcheckServiceFactory::RegisterProfilePrefs( |
75 user_prefs::PrefRegistrySyncable* user_prefs) { | 75 user_prefs::PrefRegistrySyncable* user_prefs) { |
76 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. | 76 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |
77 user_prefs->RegisterLocalizedStringPref( | 77 user_prefs->RegisterLocalizedStringPref( |
78 prefs::kSpellCheckDictionary, | 78 prefs::kSpellCheckDictionary, |
79 IDS_SPELLCHECK_DICTIONARY, | 79 IDS_SPELLCHECK_DICTIONARY, |
80 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 80 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
81 user_prefs->RegisterBooleanPref( | 81 user_prefs->RegisterBooleanPref( |
82 prefs::kSpellCheckConfirmDialogShown, | 82 prefs::kSpellCheckConfirmDialogShown, |
83 false, | 83 false, |
84 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 84 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
(...skipping 12 matching lines...) Expand all Loading... |
97 } | 97 } |
98 | 98 |
99 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( | 99 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( |
100 content::BrowserContext* context) const { | 100 content::BrowserContext* context) const { |
101 return chrome::GetBrowserContextRedirectedInIncognito(context); | 101 return chrome::GetBrowserContextRedirectedInIncognito(context); |
102 } | 102 } |
103 | 103 |
104 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { | 104 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { |
105 return true; | 105 return true; |
106 } | 106 } |
OLD | NEW |