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

Unified Diff: chrome/browser/spellchecker/spellcheck_message_filter.cc

Issue 9289007: Profiles: Move the Spelling system onto a ProfileKeyedServiceFactory. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove stray mark Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/spellchecker/spellcheck_message_filter.cc
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.cc b/chrome/browser/spellchecker/spellcheck_message_filter.cc
index 579d40a8093b2b0dd1cf11754cd315e4e6315960..19d9088129d779a4041285f49940c49095a74fba 100644
--- a/chrome/browser/spellchecker/spellcheck_message_filter.cc
+++ b/chrome/browser/spellchecker/spellcheck_message_filter.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_host.h"
#include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
#include "chrome/common/spellcheck_messages.h"
@@ -50,15 +51,18 @@ void SpellCheckMessageFilter::OnSpellCheckerRequestDictionary() {
// generally only be called once per session, as after the first call, all
// future renderers will be passed the initialization information on startup
// (or when the dictionary changes in some way).
- if (profile->GetSpellCheckHost()) {
+ SpellCheckHost* spell_check_host =
+ SpellCheckFactory::GetHostForProfile(profile);
+
+ if (spell_check_host) {
// The spellchecker initialization already started and finished; just send
// it to the renderer.
- profile->GetSpellCheckHost()->InitForRenderer(host);
+ spell_check_host->InitForRenderer(host);
} else {
// We may have gotten multiple requests from different renderers. We don't
// want to initialize multiple times in this case, so we set |force| to
// false.
- profile->ReinitializeSpellCheckHost(false);
+ SpellCheckFactory::ReinitializeSpellCheckHost(profile, false);
}
}
@@ -70,7 +74,8 @@ void SpellCheckMessageFilter::OnNotifyChecked(const string16& word,
return; // Teardown.
// Delegates to SpellCheckHost which tracks the stats of our spellchecker.
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
- SpellCheckHost* spellcheck_host = profile->GetSpellCheckHost();
+ SpellCheckHost* spellcheck_host =
+ SpellCheckFactory::GetHostForProfile(profile);
if (spellcheck_host && spellcheck_host->GetMetrics())
spellcheck_host->GetMetrics()->RecordCheckedWordStats(word, misspelled);
}

Powered by Google App Engine
This is Rietveld 408576698