From eda2b5a29df212809fb3ee5a8e8c42017b635f1c Mon Sep 17 00:00:00 2001 From: "sidchat@google.com" Date: Tue, 12 May 2009 19:30:21 +0000 Subject: Add Automatic spell correction support in Chrome. Issue=7624 Review URL: http://codereview.chromium.org/42608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15888 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_view.cc | 9 +++++++++ chrome/renderer/render_view.h | 2 ++ 2 files changed, 11 insertions(+) (limited to 'chrome/renderer') diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 99e662b..979f74f 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2298,6 +2298,15 @@ void RenderView::SpellCheck(const std::wstring& word, int& misspell_location, &misspell_length)); } +void RenderView::GetAutoCorrectWord(const std::wstring& misspelled_word, + std::wstring& autocorrect_word) { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kAutoSpellCorrect)) { + Send(new ViewHostMsg_GetAutoCorrectWord(routing_id_, misspelled_word, + &autocorrect_word)); + } +} + void RenderView::SetInputMethodState(bool enabled) { // Save the updated IME status and mark the input focus has been updated. // The IME status is to be sent to a browser process next time when diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 7b5665d..a993327 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -309,6 +309,8 @@ class RenderView : public RenderWidget, virtual bool WasOpenedByUserGesture() const; virtual void SpellCheck(const std::wstring& word, int& misspell_location, int& misspell_length); + virtual void GetAutoCorrectWord(const std::wstring& misspelled_word, + std::wstring& autocorrect_word); virtual void SetInputMethodState(bool enabled); virtual void ScriptedPrint(WebFrame* frame); virtual void WebInspectorOpened(int num_resources); -- cgit v1.1