Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/spellchecker/spellcheck_factory.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698