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

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

Issue 790413002: Focus following for the non-editable controls on web page in magnifier mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a nit. Created 6 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 unified diff | Download patch
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 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 Send(new ViewHostMsg_TakeFocus(routing_id_, false)); 1921 Send(new ViewHostMsg_TakeFocus(routing_id_, false));
1922 } 1922 }
1923 1923
1924 void RenderViewImpl::focusPrevious() { 1924 void RenderViewImpl::focusPrevious() {
1925 Send(new ViewHostMsg_TakeFocus(routing_id_, true)); 1925 Send(new ViewHostMsg_TakeFocus(routing_id_, true));
1926 } 1926 }
1927 1927
1928 void RenderViewImpl::focusedNodeChanged(const WebNode& node) { 1928 void RenderViewImpl::focusedNodeChanged(const WebNode& node) {
1929 has_scrolled_focused_editable_node_into_rect_ = false; 1929 has_scrolled_focused_editable_node_into_rect_ = false;
1930 1930
1931 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(node))); 1931 gfx::Rect node_bounds;
1932 if (!node.isNull() && node.isElementNode()) {
1933 WebNode web_node = const_cast<WebNode&>(node);
1934 node_bounds = gfx::Rect(web_node.to<WebElement>().boundsInViewportSpace());
1935 }
sadrul 2014/12/12 17:13:49 Instead of this, why not include the bounds with t
jennyz 2014/12/12 23:14:45 Do you mean include |node_bounds| in call to Focus
sadrul 2014/12/15 18:37:16 I mean including the bounds in WebViewClient::focu
jennyz 2014/12/15 23:24:55 As we chatted, this will need to make change in bl
1936 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(node),
1937 node_bounds));
1932 1938
1933 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(node)); 1939 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(node));
1934 1940
1935 // TODO(dmazzoni): this should be part of RenderFrameObserver. 1941 // TODO(dmazzoni): this should be part of RenderFrameObserver.
1936 GetMainRenderFrame()->FocusedNodeChanged(node); 1942 GetMainRenderFrame()->FocusedNodeChanged(node);
1937 } 1943 }
1938 1944
1939 void RenderViewImpl::didUpdateLayout() { 1945 void RenderViewImpl::didUpdateLayout() {
1940 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidUpdateLayout()); 1946 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidUpdateLayout());
1941 1947
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after
4128 std::vector<gfx::Size> sizes; 4134 std::vector<gfx::Size> sizes;
4129 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4135 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4130 if (!url.isEmpty()) 4136 if (!url.isEmpty())
4131 urls.push_back( 4137 urls.push_back(
4132 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4138 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4133 } 4139 }
4134 SendUpdateFaviconURL(urls); 4140 SendUpdateFaviconURL(urls);
4135 } 4141 }
4136 4142
4137 } // namespace content 4143 } // namespace content
OLDNEW
« content/public/browser/render_view_host.h ('K') | « content/public/browser/render_view_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698