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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 13731: [chromium-reviews] Add "Enable spell check for this field" menu option in sub context menu for c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate) 322 IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate)
323 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 323 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
324 IPC_MESSAGE_HANDLER(ViewMsg_LoadAlternateHTMLText, OnLoadAlternateHTMLText) 324 IPC_MESSAGE_HANDLER(ViewMsg_LoadAlternateHTMLText, OnLoadAlternateHTMLText)
325 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding) 325 IPC_MESSAGE_HANDLER(ViewMsg_StopFinding, OnStopFinding)
326 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) 326 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo)
327 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) 327 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo)
328 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) 328 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut)
329 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) 329 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy)
330 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste) 330 IPC_MESSAGE_HANDLER(ViewMsg_Paste, OnPaste)
331 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace) 331 IPC_MESSAGE_HANDLER(ViewMsg_Replace, OnReplace)
332 IPC_MESSAGE_HANDLER(ViewMsg_ToggleSpellCheck, OnToggleSpellCheck)
332 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete) 333 IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete)
333 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) 334 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll)
334 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) 335 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
335 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) 336 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind)
336 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) 337 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
337 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) 338 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
338 IPC_MESSAGE_HANDLER(ViewMsg_InspectElement, OnInspectElement) 339 IPC_MESSAGE_HANDLER(ViewMsg_InspectElement, OnInspectElement)
339 IPC_MESSAGE_HANDLER(ViewMsg_ShowJavaScriptConsole, OnShowJavaScriptConsole) 340 IPC_MESSAGE_HANDLER(ViewMsg_ShowJavaScriptConsole, OnShowJavaScriptConsole)
340 IPC_MESSAGE_HANDLER(ViewMsg_DownloadImage, OnDownloadImage) 341 IPC_MESSAGE_HANDLER(ViewMsg_DownloadImage, OnDownloadImage)
341 IPC_MESSAGE_HANDLER(ViewMsg_ScriptEvalRequest, OnScriptEvalRequest) 342 IPC_MESSAGE_HANDLER(ViewMsg_ScriptEvalRequest, OnScriptEvalRequest)
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 webview()->GetFocusedFrame()->Paste(); 970 webview()->GetFocusedFrame()->Paste();
970 } 971 }
971 972
972 void RenderView::OnReplace(const std::wstring& text) { 973 void RenderView::OnReplace(const std::wstring& text) {
973 if (!webview()) 974 if (!webview())
974 return; 975 return;
975 976
976 webview()->GetFocusedFrame()->Replace(text); 977 webview()->GetFocusedFrame()->Replace(text);
977 } 978 }
978 979
980 void RenderView::OnToggleSpellCheck() {
981 if (!webview())
982 return;
983
984 webview()->GetFocusedFrame()->ToggleSpellCheck();
985 }
986
979 void RenderView::OnDelete() { 987 void RenderView::OnDelete() {
980 if (!webview()) 988 if (!webview())
981 return; 989 return;
982 990
983 webview()->GetFocusedFrame()->Delete(); 991 webview()->GetFocusedFrame()->Delete();
984 } 992 }
985 993
986 void RenderView::OnSelectAll() { 994 void RenderView::OnSelectAll() {
987 if (!webview()) 995 if (!webview())
988 return; 996 return;
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 ViewHostMsg_ContextMenu_Params params; 1952 ViewHostMsg_ContextMenu_Params params;
1945 params.type = type; 1953 params.type = type;
1946 params.x = x; 1954 params.x = x;
1947 params.y = y; 1955 params.y = y;
1948 params.image_url = image_url; 1956 params.image_url = image_url;
1949 params.link_url = link_url; 1957 params.link_url = link_url;
1950 params.page_url = page_url; 1958 params.page_url = page_url;
1951 params.frame_url = frame_url; 1959 params.frame_url = frame_url;
1952 params.selection_text = selection_text; 1960 params.selection_text = selection_text;
1953 params.misspelled_word = misspelled_word; 1961 params.misspelled_word = misspelled_word;
1962 params.spellcheck_enabled =
1963 webview->GetFocusedFrame()->SpellCheckEnabled();
1954 params.edit_flags = edit_flags; 1964 params.edit_flags = edit_flags;
1955 params.security_info = security_info; 1965 params.security_info = security_info;
1956 Send(new ViewHostMsg_ContextMenu(routing_id_, params)); 1966 Send(new ViewHostMsg_ContextMenu(routing_id_, params));
1957 } 1967 }
1958 1968
1959 void RenderView::StartDragging(WebView* webview, const WebDropData& drop_data) { 1969 void RenderView::StartDragging(WebView* webview, const WebDropData& drop_data) {
1960 Send(new ViewHostMsg_StartDragging(routing_id_, drop_data)); 1970 Send(new ViewHostMsg_StartDragging(routing_id_, drop_data));
1961 } 1971 }
1962 1972
1963 void RenderView::TakeFocus(WebView* webview, bool reverse) { 1973 void RenderView::TakeFocus(WebView* webview, bool reverse) {
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 template_resource_id)); 2749 template_resource_id));
2740 2750
2741 if (template_html.empty()) { 2751 if (template_html.empty()) {
2742 NOTREACHED() << "unable to load template. ID: " << template_resource_id; 2752 NOTREACHED() << "unable to load template. ID: " << template_resource_id;
2743 return ""; 2753 return "";
2744 } 2754 }
2745 // "t" is the id of the templates root node. 2755 // "t" is the id of the templates root node.
2746 return jstemplate_builder::GetTemplateHtml( 2756 return jstemplate_builder::GetTemplateHtml(
2747 template_html, &error_strings, "t"); 2757 template_html, &error_strings, "t");
2748 } 2758 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698