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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10820062: [Mac]: Enable speech sub-menu under the edit menu and pipe it through to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
Index: content/renderer/render_view_impl.cc
===================================================================
--- content/renderer/render_view_impl.cc (revision 148651)
+++ content/renderer/render_view_impl.cc (working copy)
@@ -866,6 +866,9 @@
IPC_MESSAGE_HANDLER(ViewMsg_Delete, OnDelete)
IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll)
IPC_MESSAGE_HANDLER(ViewMsg_SelectRange, OnSelectRange)
+#if defined(OS_MACOSX)
+ IPC_MESSAGE_HANDLER(ViewMsg_SpeakSelection, OnSpeakSelection)
+#endif
IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt)
IPC_MESSAGE_HANDLER(ViewMsg_ExecuteEditCommand, OnExecuteEditCommand)
IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind)
@@ -2910,7 +2913,7 @@
int width, height;
if (base::StringToInt(tokens[0], &width) &&
base::StringToInt(tokens[1], &height))
- webview()->setFixedLayoutSize(WebSize(width,height));
+ webview()->setFixedLayoutSize(WebSize(width, height));
}
}
}
@@ -4496,7 +4499,7 @@
void RenderViewImpl::OnPostMessageEvent(
const ViewMsg_PostMessage_Params& params) {
// TODO(creis): Support sending to subframes.
- WebFrame *frame = webview()->mainFrame();
+ WebFrame* frame = webview()->mainFrame();
// Find the source frame if it exists.
// TODO(creis): Support source subframes.
@@ -4829,6 +4832,17 @@
before_unload_end_time));
}
+#if defined(OS_MACOSX)
+void RenderViewImpl::OnSpeakSelection() {
+ if (!webview())
+ return;
+
+ WebFrame* frame = webview()->focusedFrame();
+ if (frame->hasSelection())
+ Send(new ViewHostMsg_SpeakText(routing_id(), frame->selectionAsText()));
+}
+#endif
+
void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) {
// Ensure that no other in-progress navigation continues.
OnStop();
@@ -5252,7 +5266,6 @@
#endif
(*plugin_it)->SetContentAreaFocus(enable);
}
-
}
// Notify all Pepper plugins.
pepper_delegate_.OnSetFocus(enable);

Powered by Google App Engine
This is Rietveld 408576698