diff options
author | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-15 20:18:04 +0000 |
---|---|---|
committer | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-15 20:18:04 +0000 |
commit | bbbd545cc226d409d131afb806e1ae5df3e5aa73 (patch) | |
tree | 6c87d2afde518b04a7b19813c2ec360ba6afbf1f /chrome/renderer | |
parent | bdb1d32442597e46583a79c0af560e6cc9e57214 (diff) | |
download | chromium_src-bbbd545cc226d409d131afb806e1ae5df3e5aa73.zip chromium_src-bbbd545cc226d409d131afb806e1ae5df3e5aa73.tar.gz chromium_src-bbbd545cc226d409d131afb806e1ae5df3e5aa73.tar.bz2 |
Add "Enable spell check for this field" menu option in sub context menu for context menu over text box, and deploy its functionality accordingly across the code. This patch also allows manual switch-on of spell check in single line text box fields.
Review URL: http://codereview.chromium.org/13731
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 10 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 4b00d9b..87dc54e 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -329,6 +329,7 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) + IPC_MESSAGE_HANDLER(ViewMsg_ToggleSpellCheck, OnToggleSpellCheck) IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) @@ -976,6 +977,13 @@ void RenderView::OnReplace(const std::wstring& text) { webview()->GetFocusedFrame()->Replace(text); } +void RenderView::OnToggleSpellCheck() { + if (!webview()) + return; + + webview()->GetFocusedFrame()->ToggleSpellCheck(); +} + void RenderView::OnDelete() { if (!webview()) return; @@ -1951,6 +1959,8 @@ void RenderView::ShowContextMenu(WebView* webview, params.frame_url = frame_url; params.selection_text = selection_text; params.misspelled_word = misspelled_word; + params.spellcheck_enabled = + webview->GetFocusedFrame()->SpellCheckEnabled(); params.edit_flags = edit_flags; params.security_info = security_info; Send(new ViewHostMsg_ContextMenu(routing_id_, params)); diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 0d6cda8..e82ebac 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -396,6 +396,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, void OnCopy(); void OnPaste(); void OnReplace(const std::wstring& text); + void OnToggleSpellCheck(); void OnDelete(); void OnSelectAll(); void OnCopyImageAt(int x, int y); |