Chromium Code Reviews| Index: content/browser/renderer_host/render_view_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc |
| index bd37a3cbb05e221e57d090cad2642c1a0d5d627b..51fcc5fa86cf734661e3b6391814091724fe1cef 100644 |
| --- a/content/browser/renderer_host/render_view_host_impl.cc |
| +++ b/content/browser/renderer_host/render_view_host_impl.cc |
| @@ -1223,7 +1223,8 @@ void RenderViewHostImpl::OnTakeFocus(bool reverse) { |
| view->TakeFocus(reverse); |
| } |
| -void RenderViewHostImpl::OnFocusedNodeChanged(bool is_editable_node) { |
| +void RenderViewHostImpl::OnFocusedNodeChanged(bool is_editable_node, |
| + const gfx::Rect& node_bounds) { |
|
oshima
2014/12/11 19:08:58
ditto
jennyz
2014/12/12 16:11:19
Done.
|
| is_focused_element_editable_ = is_editable_node; |
| if (view_) |
| view_->FocusedNodeChanged(is_editable_node); |
| @@ -1237,10 +1238,17 @@ void RenderViewHostImpl::OnFocusedNodeChanged(bool is_editable_node) { |
| TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs)); |
| } |
| #endif |
| - NotificationService::current()->Notify( |
| - NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| - Source<RenderViewHost>(this), |
| - Details<const bool>(&is_editable_node)); |
| + |
| + // Convert node_bounds to screen coordinates. |
| + gfx::Rect view_bounds_in_screen = view_->GetViewBounds(); |
| + gfx::Point origin = node_bounds.origin(); |
| + origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); |
| + gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), node_bounds.width(), |
| + node_bounds.height()); |
| + FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; |
| + NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| + Source<RenderViewHost>(this), |
| + Details<FocusedNodeDetails>(&details)); |
| } |
| void RenderViewHostImpl::OnUserGesture() { |