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); |