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

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

Issue 1275813002: Implemented typo recognition in Chrome for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@4_remove_mac_redundancies
Patch Set: Several style changes Created 5 years, 4 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
Index: chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc b/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc
index 4c7a6c8c2239632cf080c976e6c18a63d524d54b..50316a7a94f968c58fadbc30327b8fa7a5e6a7c6 100644
--- a/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc
+++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h"
+#include "chrome/browser/spellchecker/spellchecker_session_bridge_android.h"
#include "chrome/common/spellcheck_messages.h"
#include "chrome/common/spellcheck_result.h"
#include "content/public/browser/browser_thread.h"
@@ -13,22 +14,30 @@ using content::BrowserThread;
SpellCheckMessageFilterPlatform::SpellCheckMessageFilterPlatform(
int render_process_id)
: BrowserMessageFilter(SpellCheckMsgStart),
- render_process_id_(render_process_id) {
-}
+ render_process_id_(render_process_id),
+ impl_(new SpellCheckerSessionBridge(render_process_id)) {}
void SpellCheckMessageFilterPlatform::OverrideThreadForMessage(
const IPC::Message& message, BrowserThread::ID* thread) {
+ if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID)
+ *thread = BrowserThread::UI;
}
bool SpellCheckMessageFilterPlatform::OnMessageReceived(
const IPC::Message& message) {
- return true;
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(SpellCheckMessageFilterPlatform, message)
+ IPC_MESSAGE_HANDLER(SpellCheckHostMsg_RequestTextCheck, OnRequestTextCheck)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
}
// static
void SpellCheckMessageFilterPlatform::CombineResults(
std::vector<SpellCheckResult>* remote_results,
const std::vector<SpellCheckResult>& local_results) {
+ NOTREACHED();
}
SpellCheckMessageFilterPlatform::~SpellCheckMessageFilterPlatform() {}
@@ -37,18 +46,22 @@ void SpellCheckMessageFilterPlatform::OnCheckSpelling(
const base::string16& word,
int route_id,
bool* correct) {
+ NOTREACHED();
}
void SpellCheckMessageFilterPlatform::OnFillSuggestionList(
const base::string16& word,
std::vector<base::string16>* suggestions) {
+ NOTREACHED();
}
void SpellCheckMessageFilterPlatform::OnShowSpellingPanel(bool show) {
+ NOTREACHED();
}
void SpellCheckMessageFilterPlatform::OnUpdateSpellingPanelWithMisspelledWord(
const base::string16& word) {
+ NOTREACHED();
}
void SpellCheckMessageFilterPlatform::OnRequestTextCheck(
@@ -56,13 +69,17 @@ void SpellCheckMessageFilterPlatform::OnRequestTextCheck(
int identifier,
const base::string16& text,
std::vector<SpellCheckMarker> markers) {
+ DCHECK(!text.empty());
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ impl_->RequestTextCheck(route_id, identifier, text);
}
int SpellCheckMessageFilterPlatform::ToDocumentTag(int route_id) {
- NOTREACHED();
- return -1;
+ NOTREACHED();
+ return -1;
}
void SpellCheckMessageFilterPlatform::RetireDocumentTag(int route_id) {
- NOTREACHED();
+ NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698