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

Unified Diff: webkit/glue/context_menu_client_impl.cc

Issue 16204: Fix 3474: Context menu issues when page is zoomed.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/context_menu_client_impl.cc
===================================================================
--- webkit/glue/context_menu_client_impl.cc (revision 7349)
+++ webkit/glue/context_menu_client_impl.cc (working copy)
@@ -144,6 +144,14 @@
WebCore::IntPoint menu_point =
selected_frame->view()->contentsToWindow(r.point());
+ // Adjust for any page zoom.
+ if (selected_frame->pageZoomFactor() != 1.0f) {
+ float zoom_factor = selected_frame->pageZoomFactor();
+ menu_point.setX(static_cast<int>(menu_point.x() * zoom_factor));
+ menu_point.setY(static_cast<int>(menu_point.y() * zoom_factor));
+ r = selected_frame->eventHandler()->hitTestResultAtPoint(menu_point, false);
+ }
+
ContextNode::Type type = ContextNode::NONE;
// Links, Images and Image-Links take preference over all else.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698