Commit 9cf61854 authored by rouslan@chromium.org's avatar rouslan@chromium.org

Send ADD_TO_DICT feedback to spelling service when user adds word to dictionary

When a user of the spelling service right-clicks on a misspelled word and 
selects 'Add to dictionary', the SpellingMenuObserver notifies spelling service
feedback sender. This feedback will be used to improve spellcheck suggestions 
from spelling service.

BUG=170514

Review URL: https://chromiumcodereview.appspot.com/15736012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202938 0039d316-1c4b-4281-b951-d872f2087c98
parent 8d4c276d
......@@ -276,15 +276,17 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) {
if (command_id == IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION ||
command_id == IDC_SPELLCHECK_ADD_TO_DICTIONARY) {
// GetHostForProfile() can return null when the suggested word is
// provided by Web SpellCheck API.
// GetHostForProfile() can return null when the suggested word is provided
// by Web SpellCheck API.
Profile* profile = proxy_->GetProfile();
if (profile) {
SpellcheckService* spellcheck_service =
SpellcheckService* spellcheck =
SpellcheckServiceFactory::GetForProfile(profile);
if (spellcheck_service)
spellcheck_service->GetCustomDictionary()->AddWord(
UTF16ToUTF8(misspelled_word_));
if (spellcheck) {
spellcheck->GetCustomDictionary()->AddWord(UTF16ToUTF8(
misspelled_word_));
spellcheck->GetFeedbackSender()->AddedToDictionary(misspelling_hash_);
}
}
#if defined(OS_MACOSX)
spellcheck_mac::AddWord(misspelled_word_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment