OLD | NEW |
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 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1909 void RenderViewImpl::focusedNodeChanged(const WebNode& fromNode, | 1909 void RenderViewImpl::focusedNodeChanged(const WebNode& fromNode, |
1910 const WebNode& toNode) { | 1910 const WebNode& toNode) { |
1911 has_scrolled_focused_editable_node_into_rect_ = false; | 1911 has_scrolled_focused_editable_node_into_rect_ = false; |
1912 | 1912 |
1913 gfx::Rect node_bounds; | 1913 gfx::Rect node_bounds; |
1914 if (!toNode.isNull() && toNode.isElementNode()) { | 1914 if (!toNode.isNull() && toNode.isElementNode()) { |
1915 WebNode web_node = const_cast<WebNode&>(toNode); | 1915 WebNode web_node = const_cast<WebNode&>(toNode); |
1916 node_bounds = gfx::Rect(web_node.to<WebElement>().boundsInViewportSpace()); | 1916 node_bounds = gfx::Rect(web_node.to<WebElement>().boundsInViewportSpace()); |
1917 } | 1917 } |
1918 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(toNode), | 1918 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(toNode), |
1919 node_bounds)); | 1919 IsPluginNode(toNode), node_bounds)); |
1920 | 1920 |
1921 // TODO(estade): remove. | 1921 // TODO(estade): remove. |
1922 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(toNode)); | 1922 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(toNode)); |
1923 | 1923 |
1924 RenderFrameImpl* previous_frame = nullptr; | 1924 RenderFrameImpl* previous_frame = nullptr; |
1925 if (!fromNode.isNull()) | 1925 if (!fromNode.isNull()) |
1926 previous_frame = RenderFrameImpl::FromWebFrame(fromNode.document().frame()); | 1926 previous_frame = RenderFrameImpl::FromWebFrame(fromNode.document().frame()); |
1927 RenderFrameImpl* new_frame = nullptr; | 1927 RenderFrameImpl* new_frame = nullptr; |
1928 if (!toNode.isNull()) | 1928 if (!toNode.isNull()) |
1929 new_frame = RenderFrameImpl::FromWebFrame(toNode.document().frame()); | 1929 new_frame = RenderFrameImpl::FromWebFrame(toNode.document().frame()); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2241 if (base::LowerCaseEqualsASCII(element.attributeValue(i), "textbox")) | 2241 if (base::LowerCaseEqualsASCII(element.attributeValue(i), "textbox")) |
2242 return true; | 2242 return true; |
2243 break; | 2243 break; |
2244 } | 2244 } |
2245 } | 2245 } |
2246 } | 2246 } |
2247 | 2247 |
2248 return false; | 2248 return false; |
2249 } | 2249 } |
2250 | 2250 |
| 2251 bool RenderViewImpl::IsPluginNode(const WebNode& node) const { |
| 2252 if (node.isNull()) |
| 2253 return false; |
| 2254 |
| 2255 return node.pluginContainer(); |
| 2256 } |
| 2257 |
2251 bool RenderViewImpl::ShouldDisplayScrollbars(int width, int height) const { | 2258 bool RenderViewImpl::ShouldDisplayScrollbars(int width, int height) const { |
2252 return (!send_preferred_size_changes_ || | 2259 return (!send_preferred_size_changes_ || |
2253 (disable_scrollbars_size_limit_.width() <= width || | 2260 (disable_scrollbars_size_limit_.width() <= width || |
2254 disable_scrollbars_size_limit_.height() <= height)); | 2261 disable_scrollbars_size_limit_.height() <= height)); |
2255 } | 2262 } |
2256 | 2263 |
2257 int RenderViewImpl::GetEnabledBindings() const { | 2264 int RenderViewImpl::GetEnabledBindings() const { |
2258 return enabled_bindings_; | 2265 return enabled_bindings_; |
2259 } | 2266 } |
2260 | 2267 |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3794 std::vector<gfx::Size> sizes; | 3801 std::vector<gfx::Size> sizes; |
3795 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3802 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3796 if (!url.isEmpty()) | 3803 if (!url.isEmpty()) |
3797 urls.push_back( | 3804 urls.push_back( |
3798 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3805 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3799 } | 3806 } |
3800 SendUpdateFaviconURL(urls); | 3807 SendUpdateFaviconURL(urls); |
3801 } | 3808 } |
3802 | 3809 |
3803 } // namespace content | 3810 } // namespace content |
OLD | NEW |