Index: chrome/browser/spellchecker/spellcheck_service.cc |
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc |
index 848dfc7c72e1ccba819f45479df5cda8bc578529..2bb13aebe3f747f25e292106606dee5dbc40e1bf 100644 |
--- a/chrome/browser/spellchecker/spellcheck_service.cc |
+++ b/chrome/browser/spellchecker/spellcheck_service.cc |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" |
#include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
+#include "chrome/browser/spellchecker/spelling_service_client.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/spellcheck_messages.h" |
#include "components/user_prefs/user_prefs.h" |
@@ -307,6 +308,7 @@ void SpellcheckService::OnSpellCheckDictionaryChanged() { |
chrome::spellcheck_common::GetISOLanguageCountryCodeFromLocale( |
dictionary, &language_code, &country_code); |
feedback_sender_->OnLanguageCountryChange(language_code, country_code); |
+ UpdateFeedbackSenderState(); |
} |
void SpellcheckService::OnUseSpellingServiceChanged() { |
@@ -314,4 +316,14 @@ void SpellcheckService::OnUseSpellingServiceChanged() { |
prefs::kSpellCheckUseSpellingService); |
if (metrics_) |
metrics_->RecordSpellingServiceStats(enabled); |
+ UpdateFeedbackSenderState(); |
+} |
+ |
+void SpellcheckService::UpdateFeedbackSenderState() { |
+ if (SpellingServiceClient::IsAvailable( |
+ context_, SpellingServiceClient::SPELLCHECK)) { |
+ feedback_sender_->StartFeedbackCollection(); |
+ } else { |
+ feedback_sender_->StopFeedbackCollection(); |
+ } |
} |