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 91a492327bb85b3858791e72c76e6c43339aee8c..c1cb88d8434807eaa76e90496cfb22c3c4aaf340 100644 |
--- a/chrome/browser/tab_contents/spelling_menu_observer.cc |
+++ b/chrome/browser/tab_contents/spelling_menu_observer.cc |
@@ -38,6 +38,7 @@ SpellingMenuObserver::SpellingMenuObserver(RenderViewContextMenuProxy* proxy) |
: proxy_(proxy), |
loading_frame_(0), |
succeeded_(false), |
+ misspelling_hash_(0), |
client_(new SpellingServiceClient) { |
if (proxy && proxy->GetProfile()) { |
integrate_spelling_service_.Init(prefs::kSpellCheckUseSpellingService, |
@@ -67,6 +68,7 @@ void SpellingMenuObserver::InitMenu(const content::ContextMenuParams& params) { |
suggestions_ = params.dictionary_suggestions; |
misspelled_word_ = params.misspelled_word; |
+ misspelling_hash_ = params.misspelling_hash; |
bool use_suggestions = SpellingServiceClient::IsAvailable( |
profile, SpellingServiceClient::SUGGEST); |
@@ -345,6 +347,17 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) { |
} |
} |
+void SpellingMenuObserver::OnMenuCancel() { |
+ Profile* profile = proxy_->GetProfile(); |
+ if (!profile) |
+ return; |
+ SpellcheckService* spellcheck = |
+ SpellcheckServiceFactory::GetForProfile(profile); |
+ if (!spellcheck) |
+ return; |
+ spellcheck->GetFeedbackSender()->IgnoredSuggestions(misspelling_hash_); |
+} |
+ |
void SpellingMenuObserver::OnTextCheckComplete( |
SpellingServiceClient::ServiceType type, |
bool success, |