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

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

Issue 15750002: Send IGNORE feedback to spellcheck service when user cancels spellcheck menu (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Initialize misspelling hash 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 | « chrome/browser/tab_contents/spelling_menu_observer.h ('k') | content/public/common/context_menu_params.cc » ('j') | 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 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,
« no previous file with comments | « chrome/browser/tab_contents/spelling_menu_observer.h ('k') | content/public/common/context_menu_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698