| 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 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 | 1934 |
| 1935 // TODO(esprehn): Blink only ever passes Elements, this should take WebElement. | 1935 // TODO(esprehn): Blink only ever passes Elements, this should take WebElement. |
| 1936 void RenderViewImpl::focusedNodeChanged(const WebNode& fromNode, | 1936 void RenderViewImpl::focusedNodeChanged(const WebNode& fromNode, |
| 1937 const WebNode& toNode) { | 1937 const WebNode& toNode) { |
| 1938 has_scrolled_focused_editable_node_into_rect_ = false; | 1938 has_scrolled_focused_editable_node_into_rect_ = false; |
| 1939 | 1939 |
| 1940 gfx::Rect node_bounds; | 1940 gfx::Rect node_bounds; |
| 1941 bool is_editable = false; | 1941 bool is_editable = false; |
| 1942 if (!toNode.isNull() && toNode.isElementNode()) { | 1942 if (!toNode.isNull() && toNode.isElementNode()) { |
| 1943 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>(); | 1943 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>(); |
| 1944 node_bounds = gfx::Rect(element.boundsInViewportSpace()); | 1944 node_bounds = gfx::Rect(element.boundsInViewport()); |
| 1945 is_editable = element.isEditable(); | 1945 is_editable = element.isEditable(); |
| 1946 } | 1946 } |
| 1947 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, is_editable, | 1947 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, is_editable, |
| 1948 node_bounds)); | 1948 node_bounds)); |
| 1949 | 1949 |
| 1950 // TODO(estade): remove. | 1950 // TODO(estade): remove. |
| 1951 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(toNode)); | 1951 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(toNode)); |
| 1952 | 1952 |
| 1953 RenderFrameImpl* previous_frame = nullptr; | 1953 RenderFrameImpl* previous_frame = nullptr; |
| 1954 if (!fromNode.isNull()) | 1954 if (!fromNode.isNull()) |
| (...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3720 if (IsUseZoomForDSFEnabled()) { | 3720 if (IsUseZoomForDSFEnabled()) { |
| 3721 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); | 3721 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); |
| 3722 webview()->setZoomFactorForDeviceScaleFactor( | 3722 webview()->setZoomFactorForDeviceScaleFactor( |
| 3723 device_scale_factor_); | 3723 device_scale_factor_); |
| 3724 } else { | 3724 } else { |
| 3725 webview()->setDeviceScaleFactor(device_scale_factor_); | 3725 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3726 } | 3726 } |
| 3727 } | 3727 } |
| 3728 | 3728 |
| 3729 } // namespace content | 3729 } // namespace content |
| OLD | NEW |