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

Unified Diff: content/renderer/render_view_impl.cc

Issue 12321005: Enable touch based selection and editing for webpages behind a flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include unittest in only chromeos builds Created 7 years, 8 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 | « content/renderer/render_view_impl.h ('k') | content/test/data/touch_selection.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index b78531b24dcc3d46317e6e1fb898677aa5908944..adae144f7d6ffd390b5edf64d2bac0c7ee9cc437 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -761,6 +761,9 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) {
if (command_line.HasSwitch(switches::kEnableTouchDragDrop))
webview()->settings()->setTouchDragDropEnabled(true);
+ if (command_line.HasSwitch(switches::kEnableTouchEditing))
+ webview()->settings()->setTouchEditingEnabled(true);
+
if (!params->frame_name.empty())
webview()->mainFrame()->setName(params->frame_name);
webview()->settings()->setMinimumTimerInterval(
@@ -1101,6 +1104,7 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks,
OnGetSerializedHtmlDataForCurrentPageWithLocalLinks)
IPC_MESSAGE_HANDLER(ViewMsg_ContextMenuClosed, OnContextMenuClosed)
+ IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu)
// TODO(viettrungluu): Move to a separate message filter.
IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune,
OnSetHistoryLengthAndPrune)
@@ -4763,6 +4767,7 @@ void RenderViewImpl::SyncSelectionIfRequired() {
selection_range_ = range;
Send(new ViewHostMsg_SelectionChanged(routing_id_, text, offset, range));
}
+ UpdateSelectionBounds();
}
GURL RenderViewImpl::GetAlternateErrorPageURL(const GURL& failed_url,
@@ -6463,6 +6468,11 @@ void RenderViewImpl::OnContextMenuClosed(
}
}
+void RenderViewImpl::OnShowContextMenu() {
+ if (webview())
+ webview()->showContextMenu();
+}
+
void RenderViewImpl::OnEnableViewSourceMode() {
if (!webview())
return;
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/data/touch_selection.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698