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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 342143004: Defect 248426: Speak rendered text when no selection is made on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a comment for TTS handler in render_widget_host_view_mac Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 else 1299 else
1300 focused_plugin_id_ = -1; 1300 focused_plugin_id_ = -1;
1301 } 1301 }
1302 #endif 1302 #endif
1303 1303
1304 #if defined(OS_MACOSX) 1304 #if defined(OS_MACOSX)
1305 void RenderViewImpl::PluginFocusChanged(bool focused, int plugin_id) { 1305 void RenderViewImpl::PluginFocusChanged(bool focused, int plugin_id) {
1306 Send(new ViewHostMsg_PluginFocusChanged(routing_id(), focused, plugin_id)); 1306 Send(new ViewHostMsg_PluginFocusChanged(routing_id(), focused, plugin_id));
1307 } 1307 }
1308 1308
1309 void RenderViewImpl::OnGetRenderedText() {
1310 if (!webview())
1311 return;
1312 // Get rendered text from WebLocalFrame.
1313 // TODO: Currently IPC truncates any data that has a
1314 // size > kMaximumMessageSize. May be split the text into smaller chunks and
1315 // send back using multiple IPC. See http://crbug.com/393444.
1316 static const size_t kMaximumMessageSize = 8 * 1024 * 1024;
1317 std::string text = webview()->mainFrame()->contentAsText(
1318 kMaximumMessageSize).utf8();
1319
1320 Send(new ViewMsg_GetRenderedTextCompleted(routing_id(), text));
1321 }
1322
1309 void RenderViewImpl::StartPluginIme() { 1323 void RenderViewImpl::StartPluginIme() {
1310 IPC::Message* msg = new ViewHostMsg_StartPluginIme(routing_id()); 1324 IPC::Message* msg = new ViewHostMsg_StartPluginIme(routing_id());
1311 // This message can be sent during event-handling, and needs to be delivered 1325 // This message can be sent during event-handling, and needs to be delivered
1312 // within that context. 1326 // within that context.
1313 msg->set_unblock(true); 1327 msg->set_unblock(true);
1314 Send(msg); 1328 Send(msg);
1315 } 1329 }
1316 #endif // defined(OS_MACOSX) 1330 #endif // defined(OS_MACOSX)
1317 1331
1318 #endif // ENABLE_PLUGINS 1332 #endif // ENABLE_PLUGINS
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) 1424 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
1411 #if defined(OS_ANDROID) 1425 #if defined(OS_ANDROID)
1412 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1426 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1413 OnActivateNearestFindResult) 1427 OnActivateNearestFindResult)
1414 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1428 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1415 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1429 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1416 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1430 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1417 OnUpdateTopControlsState) 1431 OnUpdateTopControlsState)
1418 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) 1432 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData)
1419 #elif defined(OS_MACOSX) 1433 #elif defined(OS_MACOSX)
1434 IPC_MESSAGE_HANDLER(ViewMsg_GetRenderedText,
1435 OnGetRenderedText)
1420 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted, 1436 IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted,
1421 OnPluginImeCompositionCompleted) 1437 OnPluginImeCompositionCompleted)
1422 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) 1438 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem)
1423 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) 1439 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize)
1424 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility) 1440 IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
1425 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged) 1441 IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
1426 #endif 1442 #endif
1427 // Adding a new message? Add platform independent ones first, then put the 1443 // Adding a new message? Add platform independent ones first, then put the
1428 // platform specific ones at the end. 1444 // platform specific ones at the end.
1429 1445
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4317 std::vector<gfx::Size> sizes; 4333 std::vector<gfx::Size> sizes;
4318 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4334 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4319 if (!url.isEmpty()) 4335 if (!url.isEmpty())
4320 urls.push_back( 4336 urls.push_back(
4321 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4337 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4322 } 4338 }
4323 SendUpdateFaviconURL(urls); 4339 SendUpdateFaviconURL(urls);
4324 } 4340 }
4325 4341
4326 } // namespace content 4342 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698