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

Unified Diff: chrome/browser/spellchecker/spellcheck_message_filter.cc

Issue 15318004: Store feedback for spellcheck results from spelling service (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments 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/spellchecker/spellcheck_message_filter.h ('k') | chrome/common/spellcheck_marker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spellcheck_message_filter.cc
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.cc b/chrome/browser/spellchecker/spellcheck_message_filter.cc
index 52ffce6f765995d1ddbefab06743e76011c6894b..66faf230f1d8b7c8aee1edad49b621fe5a7f85b0 100644
--- a/chrome/browser/spellchecker/spellcheck_message_filter.cc
+++ b/chrome/browser/spellchecker/spellcheck_message_filter.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/browser/spellchecker/spelling_service_client.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/spellcheck_marker.h"
#include "chrome/common/spellcheck_messages.h"
#include "content/public/browser/render_process_host.h"
#include "net/url_request/url_fetcher.h"
@@ -109,30 +110,37 @@ void SpellCheckMessageFilter::OnRespondDocumentMarkers(
void SpellCheckMessageFilter::OnCallSpellingService(
int route_id,
int identifier,
- const string16& text) {
+ const string16& text,
+ const std::vector<SpellCheckMarker>& markers) {
DCHECK(!text.empty());
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- CallSpellingService(text, route_id, identifier);
+ CallSpellingService(text, route_id, identifier, markers);
}
void SpellCheckMessageFilter::OnTextCheckComplete(
int route_id,
int identifier,
+ const std::vector<SpellCheckMarker>& markers,
bool success,
const string16& text,
const std::vector<SpellCheckResult>& results) {
- Send(new SpellCheckMsg_RespondSpellingService(route_id,
- identifier,
- success,
- text,
- results));
+ SpellcheckService* spellcheck =
+ SpellcheckServiceFactory::GetForRenderProcessId(render_process_id_);
+ DCHECK(spellcheck);
+ std::vector<SpellCheckResult> results_copy = results;
+ spellcheck->GetFeedbackSender()->OnSpellcheckResults(
+ &results_copy, render_process_id_, text, markers);
+ Send(new SpellCheckMsg_RespondSpellingService(
+ route_id, identifier, success, text, results_copy));
}
// CallSpellingService always executes the callback OnTextCheckComplete.
// (Which, in turn, sends a SpellCheckMsg_RespondSpellingService)
-void SpellCheckMessageFilter::CallSpellingService(const string16& text,
- int route_id,
- int identifier) {
+void SpellCheckMessageFilter::CallSpellingService(
+ const string16& text,
+ int route_id,
+ int identifier,
+ const std::vector<SpellCheckMarker>& markers) {
Profile* profile = NULL;
content::RenderProcessHost* host =
content::RenderProcessHost::FromID(render_process_id_);
@@ -146,6 +154,7 @@ void SpellCheckMessageFilter::CallSpellingService(const string16& text,
base::Bind(&SpellCheckMessageFilter::OnTextCheckComplete,
base::Unretained(this),
route_id,
- identifier));
+ identifier,
+ markers));
}
#endif
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_message_filter.h ('k') | chrome/common/spellcheck_marker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698