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) { ...@@ -276,15 +276,17 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) {
if (command_id == IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION || if (command_id == IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION ||
command_id == IDC_SPELLCHECK_ADD_TO_DICTIONARY) { command_id == IDC_SPELLCHECK_ADD_TO_DICTIONARY) {
// GetHostForProfile() can return null when the suggested word is // GetHostForProfile() can return null when the suggested word is provided
// provided by Web SpellCheck API. // by Web SpellCheck API.
Profile* profile = proxy_->GetProfile(); Profile* profile = proxy_->GetProfile();
if (profile) { if (profile) {
SpellcheckService* spellcheck_service = SpellcheckService* spellcheck =
SpellcheckServiceFactory::GetForProfile(profile); SpellcheckServiceFactory::GetForProfile(profile);
if (spellcheck_service) if (spellcheck) {
spellcheck_service->GetCustomDictionary()->AddWord( spellcheck->GetCustomDictionary()->AddWord(UTF16ToUTF8(
UTF16ToUTF8(misspelled_word_)); misspelled_word_));
spellcheck->GetFeedbackSender()->AddedToDictionary(misspelling_hash_);
}
} }
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
spellcheck_mac::AddWord(misspelled_word_); 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