diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 01:55:45 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 01:55:45 +0000 |
commit | 3e26719114a404d97e1b979fb8b86f3f3016df29 (patch) | |
tree | c2d1cb3ba190ee97649fc48fb8c86c34069b9bcb /chrome/renderer/spellchecker | |
parent | 4e69ec1031ae5a80d0d262e9f43d1af149a8dd42 (diff) | |
download | chromium_src-3e26719114a404d97e1b979fb8b86f3f3016df29.zip chromium_src-3e26719114a404d97e1b979fb8b86f3f3016df29.tar.gz chromium_src-3e26719114a404d97e1b979fb8b86f3f3016df29.tar.bz2 |
Move spellcheck messages into their own file, and dispatch them all in SpellCheckMessageFilter. The next step would be to make WebView have a setter for a WebSpellCheckClient that SpellCheckProvider implements so that spelling can be taken out of RenderView completely.
Review URL: http://codereview.chromium.org/6730045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/spellchecker')
4 files changed, 20 insertions, 20 deletions
diff --git a/chrome/renderer/spellchecker/spellcheck.cc b/chrome/renderer/spellchecker/spellcheck.cc index 4220f4a..9c700ae 100644 --- a/chrome/renderer/spellchecker/spellcheck.cc +++ b/chrome/renderer/spellchecker/spellcheck.cc @@ -8,8 +8,8 @@ #include "base/metrics/histogram.h" #include "base/time.h" #include "base/utf_string_conversions.h" -#include "chrome/common/render_messages.h" #include "chrome/common/spellcheck_common.h" +#include "chrome/common/spellcheck_messages.h" #include "chrome/renderer/render_thread.h" #include "third_party/hunspell/src/hunspell/hunspell.hxx" @@ -198,8 +198,7 @@ bool SpellCheck::InitializeIfNeeded() { return false; if (!initialized_) { - RenderThread::current()->Send( - new ViewHostMsg_SpellChecker_RequestDictionary); + RenderThread::current()->Send(new SpellCheckHostMsg_RequestDictionary); initialized_ = true; return true; } @@ -218,8 +217,8 @@ bool SpellCheck::CheckSpelling(const string16& word_to_check, int tag) { if (is_using_platform_spelling_engine_) { RenderThread::current()->Send( - new ViewHostMsg_SpellChecker_PlatformCheckSpelling(word_to_check, tag, - &word_correct)); + new SpellCheckHostMsg_PlatformCheckSpelling(word_to_check, tag, + &word_correct)); } else { std::string word_to_check_utf8(UTF16ToUTF8(word_to_check)); // Hunspell shouldn't let us exceed its max, but check just in case @@ -244,7 +243,7 @@ void SpellCheck::FillSuggestionList( std::vector<string16>* optional_suggestions) { if (is_using_platform_spelling_engine_) { RenderThread::current()->Send( - new ViewHostMsg_SpellChecker_PlatformFillSuggestionList( + new SpellCheckHostMsg_PlatformFillSuggestionList( wrong_word, optional_suggestions)); return; } diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc index 779844d..da06c1e 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider.cc @@ -4,9 +4,10 @@ #include "chrome/renderer/spellchecker/spellcheck_provider.h" -#include "chrome/common/render_messages.h" +#include "chrome/common/spellcheck_messages.h" #include "chrome/renderer/render_thread.h" #include "chrome/renderer/spellchecker/spellcheck.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingCompletion.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" @@ -38,14 +39,14 @@ void SpellCheckProvider::RequestTextChecking( return; } - Send(new ViewHostMsg_SpellChecker_PlatformRequestTextCheck( + Send(new SpellCheckHostMsg_PlatformRequestTextCheck( routing_id(), text_check_completions_.Add(completion), document_tag, text)); } -void SpellCheckProvider::OnSpellCheckerRespondTextCheck( +void SpellCheckProvider::OnRespondTextCheck( int identifier, int tag, const std::vector<WebTextCheckingResult>& results) { @@ -60,8 +61,7 @@ void SpellCheckProvider::OnSpellCheckerRespondTextCheck( bool SpellCheckProvider::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(SpellCheckProvider, message) - IPC_MESSAGE_HANDLER(ViewMsg_SpellChecker_RespondTextCheck, - OnSpellCheckerRespondTextCheck) + IPC_MESSAGE_HANDLER(SpellCheckMsg_RespondTextCheck, OnRespondTextCheck) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; diff --git a/chrome/renderer/spellchecker/spellcheck_provider.h b/chrome/renderer/spellchecker/spellcheck_provider.h index b774e35..7157f11 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.h +++ b/chrome/renderer/spellchecker/spellcheck_provider.h @@ -29,7 +29,7 @@ class SpellCheckProvider : public RenderViewObserver { SpellCheckProvider(RenderView* render_view, SpellCheck* spellcheck); virtual ~SpellCheckProvider(); - // Reqeusts async spell and grammar checker to the platform text + // Requests async spell and grammar checker to the platform text // checker, which is available on the browser process. void RequestTextChecking( const WebKit::WebString& text, @@ -50,7 +50,7 @@ class SpellCheckProvider : public RenderViewObserver { private: // A message handler that receives async results for RequestTextChecking(). - void OnSpellCheckerRespondTextCheck( + void OnRespondTextCheck( int identifier, int tag, const std::vector<WebKit::WebTextCheckingResult>& results); diff --git a/chrome/renderer/spellchecker/spellcheck_provider_unittest.cc b/chrome/renderer/spellchecker/spellcheck_provider_unittest.cc index bb63f19..bb6b7ab 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider_unittest.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider_unittest.cc @@ -5,9 +5,10 @@ #include <vector> #include "base/utf_string_conversions.h" -#include "chrome/common/render_messages.h" +#include "chrome/common/spellcheck_messages.h" #include "chrome/renderer/spellchecker/spellcheck_provider.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingCompletion.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" @@ -84,7 +85,7 @@ struct MessageParameters { MessageParameters ReadPlatformRequestTextCheck(IPC::Message* message) { MessageParameters parameters; - bool ok = ViewHostMsg_SpellChecker_PlatformRequestTextCheck::Read( + bool ok = SpellCheckHostMsg_PlatformRequestTextCheck::Read( message, ¶meters.router_id, ¶meters.request_id, @@ -98,11 +99,11 @@ void FakeMessageArrival(SpellCheckProvider* provider, const MessageParameters& parameters) { std::vector<WebKit::WebTextCheckingResult> fake_result; bool handled = provider->OnMessageReceived( - ViewMsg_SpellChecker_RespondTextCheck - (0, - parameters.request_id, - parameters.document_tag, - fake_result)); + SpellCheckMsg_RespondTextCheck( + 0, + parameters.request_id, + parameters.document_tag, + fake_result)); EXPECT_TRUE(handled); } |