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

Unified Diff: chrome/renderer/render_view.cc

Issue 227006: Move some more methods from WebViewDelegate to WebViewClient.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/api/public/WebViewClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 26935)
+++ chrome/renderer/render_view.cc (working copy)
@@ -274,6 +274,10 @@
next_page_id_ = next_page_id;
}
+void RenderView::UserMetricsRecordAction(const std::wstring& action) {
+ Send(new ViewHostMsg_UserMetricsRecordAction(routing_id_, action));
+}
+
void RenderView::PluginCrashed(base::ProcessId pid,
const FilePath& plugin_path) {
Send(new ViewHostMsg_CrashedPlugin(routing_id_, pid, plugin_path));
@@ -1513,6 +1517,30 @@
UserMetricsRecordAction(name);
}
+void RenderView::spellCheck(
+ const WebString& text, int& misspelled_offset, int& misspelled_length) {
+ EnsureDocumentTag();
+ Send(new ViewHostMsg_SpellCheck(
+ routing_id_, UTF16ToWideHack(text), document_tag_,
+ &misspelled_offset, &misspelled_length));
+}
+
+WebString RenderView::autoCorrectWord(const WebKit::WebString& word) {
+ std::wstring autocorrect_word;
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kAutoSpellCorrect)) {
+ EnsureDocumentTag();
+ Send(new ViewHostMsg_GetAutoCorrectWord(
+ routing_id_, UTF16ToWideHack(word), document_tag_, &autocorrect_word));
+ }
+ return WideToUTF16Hack(autocorrect_word);
+}
+
+void RenderView::updateSpellingUIWithMisspelledWord(const WebString& word) {
+ Send(new ViewHostMsg_UpdateSpellingPanelWithMisspelledWord(
+ routing_id_, UTF16ToWideHack(word)));
+}
+
void RenderView::runModalAlertDialog(
WebFrame* frame, const WebString& message) {
RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptAlert,
@@ -2673,39 +2701,6 @@
return opened_by_user_gesture_;
}
-void RenderView::SpellCheck(const std::wstring& word,
- int* misspell_location,
- int* misspell_length) {
- EnsureDocumentTag();
- Send(new ViewHostMsg_SpellCheck(
- routing_id_, word, document_tag_, misspell_location, misspell_length));
-}
-
-std::wstring RenderView::GetAutoCorrectWord(
- const std::wstring& misspelled_word) {
- std::wstring autocorrect_word;
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kAutoSpellCorrect)) {
- EnsureDocumentTag();
- Send(new ViewHostMsg_GetAutoCorrectWord(
- routing_id_, misspelled_word, document_tag_, &autocorrect_word));
- }
- return autocorrect_word;
-}
-
-void RenderView::ShowSpellingUI(bool show) {
- Send(new ViewHostMsg_ShowSpellingPanel(routing_id_, show));
-}
-
-void RenderView::UpdateSpellingUIWithMisspelledWord(const std::wstring& word) {
- Send(new ViewHostMsg_UpdateSpellingPanelWithMisspelledWord(
- routing_id_, word));
-}
-
-void RenderView::UserMetricsRecordAction(const std::wstring& action) {
- Send(new ViewHostMsg_UserMetricsRecordAction(routing_id_, action));
-}
-
void RenderView::DnsPrefetch(const std::vector<std::string>& host_names) {
Send(new ViewHostMsg_DnsPrefetch(host_names));
}
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/api/public/WebViewClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698