| 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);
|
| }
|
|
|