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

Unified Diff: chrome/browser/tab_contents/spelling_menu_observer.cc

Issue 15736012: Send ADD_TO_DICT feedback to spelling service when user adds word to dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge master Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/spelling_menu_observer.cc
diff --git a/chrome/browser/tab_contents/spelling_menu_observer.cc b/chrome/browser/tab_contents/spelling_menu_observer.cc
index c1cb88d8434807eaa76e90496cfb22c3c4aaf340..2bb6f121c96da7deb038f9385c3d562ff0f2e848 100644
--- a/chrome/browser/tab_contents/spelling_menu_observer.cc
+++ b/chrome/browser/tab_contents/spelling_menu_observer.cc
@@ -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 =
- SpellcheckServiceFactory::GetForProfile(profile);
- if (spellcheck_service)
- spellcheck_service->GetCustomDictionary()->AddWord(
- UTF16ToUTF8(misspelled_word_));
+ SpellcheckService* spellcheck =
+ SpellcheckServiceFactory::GetForProfile(profile);
+ if (spellcheck) {
+ spellcheck->GetCustomDictionary()->AddWord(UTF16ToUTF8(
+ misspelled_word_));
+ spellcheck->GetFeedbackSender()->AddedToDictionary(misspelling_hash_);
+ }
}
#if defined(OS_MACOSX)
spellcheck_mac::AddWord(misspelled_word_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698