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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2855353002: Make Paste Popup use selection rect for positioning (Closed)
Patch Set: fix typo Created 3 years, 7 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_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 2e952fd5a26a3ca6dfcdb4ca3cb40252a7a6939b..7e6c1fdabddf40758cc0499df6a8322ca971b0f6 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4316,14 +4316,9 @@ void RenderFrameImpl::ShowContextMenu(const blink::WebContextMenuData& data) {
if (params.src_url.spec().size() > url::kMaxURLChars)
params.src_url = GURL();
-#if defined(OS_ANDROID)
- gfx::Rect start_rect;
- gfx::Rect end_rect;
- GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect);
- params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom());
- params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom());
-#endif
-
+ blink::WebRect selection_in_window(data.selection_rect);
+ GetRenderWidget()->ConvertViewportToWindow(&selection_in_window);
+ params.selection_rect = selection_in_window;
Send(new FrameHostMsg_ContextMenu(routing_id_, params));
}
« no previous file with comments | « content/public/common/context_menu_params.h ('k') | third_party/WebKit/Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698