| 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/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 16 matching lines...) Expand all Loading... |
| 27 SpellcheckServiceFactory::SpellcheckServiceFactory() | 27 SpellcheckServiceFactory::SpellcheckServiceFactory() |
| 28 : ProfileKeyedServiceFactory("SpellcheckService", | 28 : ProfileKeyedServiceFactory("SpellcheckService", |
| 29 ProfileDependencyManager::GetInstance()) { | 29 ProfileDependencyManager::GetInstance()) { |
| 30 // TODO(erg): Uncomment these as they are initialized. | 30 // TODO(erg): Uncomment these as they are initialized. |
| 31 // DependsOn(RequestContextFactory::GetInstance()); | 31 // DependsOn(RequestContextFactory::GetInstance()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 SpellcheckServiceFactory::~SpellcheckServiceFactory() {} | 34 SpellcheckServiceFactory::~SpellcheckServiceFactory() {} |
| 35 | 35 |
| 36 ProfileKeyedService* SpellcheckServiceFactory::BuildServiceInstanceFor( | 36 ProfileKeyedService* SpellcheckServiceFactory::BuildServiceInstanceFor( |
| 37 Profile* profile) const { | 37 content::BrowserContext* context) const { |
| 38 Profile* profile = static_cast<Profile*>(context); |
| 39 |
| 38 // Many variables are initialized from the profile in the SpellcheckService. | 40 // Many variables are initialized from the profile in the SpellcheckService. |
| 39 DCHECK(profile); | 41 DCHECK(profile); |
| 40 SpellcheckService* spellcheck = new SpellcheckService(profile); | 42 SpellcheckService* spellcheck = new SpellcheckService(profile); |
| 41 | 43 |
| 42 // Instantiates Metrics object for spellchecking for use. | 44 // Instantiates Metrics object for spellchecking for use. |
| 43 spellcheck->StartRecordingMetrics( | 45 spellcheck->StartRecordingMetrics( |
| 44 profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 46 profile->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
| 45 | 47 |
| 46 return spellcheck; | 48 return spellcheck; |
| 47 } | 49 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 PrefRegistrySyncable::SYNCABLE_PREF); | 69 PrefRegistrySyncable::SYNCABLE_PREF); |
| 68 } | 70 } |
| 69 | 71 |
| 70 bool SpellcheckServiceFactory::ServiceRedirectedInIncognito() const { | 72 bool SpellcheckServiceFactory::ServiceRedirectedInIncognito() const { |
| 71 return true; | 73 return true; |
| 72 } | 74 } |
| 73 | 75 |
| 74 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { | 76 bool SpellcheckServiceFactory::ServiceIsNULLWhileTesting() const { |
| 75 return true; | 77 return true; |
| 76 } | 78 } |
| OLD | NEW |