| 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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.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/grit/locale_settings.h" | 10 #include "chrome/grit/locale_settings.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 user_prefs::PrefRegistrySyncable* user_prefs) { | 71 user_prefs::PrefRegistrySyncable* user_prefs) { |
| 72 user_prefs->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries, | 72 user_prefs->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries, |
| 73 base::MakeUnique<base::ListValue>()); | 73 base::MakeUnique<base::ListValue>()); |
| 74 // Continue registering kSpellCheckDictionary for preference migration. | 74 // Continue registering kSpellCheckDictionary for preference migration. |
| 75 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. | 75 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |
| 76 user_prefs->RegisterStringPref( | 76 user_prefs->RegisterStringPref( |
| 77 spellcheck::prefs::kSpellCheckDictionary, | 77 spellcheck::prefs::kSpellCheckDictionary, |
| 78 l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY)); | 78 l10n_util::GetStringUTF8(IDS_SPELLCHECK_DICTIONARY)); |
| 79 user_prefs->RegisterBooleanPref( | 79 user_prefs->RegisterBooleanPref( |
| 80 spellcheck::prefs::kSpellCheckUseSpellingService, false); | 80 spellcheck::prefs::kSpellCheckUseSpellingService, false); |
| 81 #if defined(OS_IOS) || defined(OS_ANDROID) | 81 #if defined(OS_ANDROID) |
| 82 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; | 82 uint32_t flags = PrefRegistry::NO_REGISTRATION_FLAGS; |
| 83 #else | 83 #else |
| 84 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; | 84 uint32_t flags = user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; |
| 85 #endif | 85 #endif |
| 86 user_prefs->RegisterBooleanPref( | 86 user_prefs->RegisterBooleanPref( |
| 87 spellcheck::prefs::kEnableSpellcheck, true, flags); | 87 spellcheck::prefs::kEnableSpellcheck, true, flags); |
| 88 } | 88 } |
| 89 | 89 |
| 90 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( | 90 content::BrowserContext* SpellcheckServiceFactory::GetBrowserContextToUse( |
| 91 content::BrowserContext* context) const { | 91 content::BrowserContext* context) const { |
| 92 return chrome::GetBrowserContextRedirectedInIncognito(context); | 92 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { | 95 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { |
| 96 return true; | 96 return true; |
| 97 } | 97 } |
| OLD | NEW |