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

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

Issue 1463723003: Return VisualViewport coords in boundsInViewportSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 1921
1922 // TODO(esprehn): Blink only ever passes Elements, this should take WebElement. 1922 // TODO(esprehn): Blink only ever passes Elements, this should take WebElement.
1923 void RenderViewImpl::focusedNodeChanged(const WebNode& fromNode, 1923 void RenderViewImpl::focusedNodeChanged(const WebNode& fromNode,
1924 const WebNode& toNode) { 1924 const WebNode& toNode) {
1925 has_scrolled_focused_editable_node_into_rect_ = false; 1925 has_scrolled_focused_editable_node_into_rect_ = false;
1926 1926
1927 gfx::Rect node_bounds; 1927 gfx::Rect node_bounds;
1928 bool is_editable = false; 1928 bool is_editable = false;
1929 if (!toNode.isNull() && toNode.isElementNode()) { 1929 if (!toNode.isNull() && toNode.isElementNode()) {
1930 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>(); 1930 WebElement element = const_cast<WebNode&>(toNode).to<WebElement>();
1931 node_bounds = gfx::Rect(element.boundsInViewportSpace()); 1931 node_bounds = gfx::Rect(element.boundsInViewport());
1932 is_editable = element.isEditable(); 1932 is_editable = element.isEditable();
1933 } 1933 }
1934 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, is_editable, 1934 Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, is_editable,
1935 node_bounds)); 1935 node_bounds));
1936 1936
1937 // TODO(estade): remove. 1937 // TODO(estade): remove.
1938 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(toNode)); 1938 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(toNode));
1939 1939
1940 RenderFrameImpl* previous_frame = nullptr; 1940 RenderFrameImpl* previous_frame = nullptr;
1941 if (!fromNode.isNull()) 1941 if (!fromNode.isNull())
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after
3715 if (IsUseZoomForDSFEnabled()) { 3715 if (IsUseZoomForDSFEnabled()) {
3716 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_); 3716 compositor_->SetPaintedDeviceScaleFactor(device_scale_factor_);
3717 webview()->setZoomFactorForDeviceScaleFactor( 3717 webview()->setZoomFactorForDeviceScaleFactor(
3718 device_scale_factor_); 3718 device_scale_factor_);
3719 } else { 3719 } else {
3720 webview()->setDeviceScaleFactor(device_scale_factor_); 3720 webview()->setDeviceScaleFactor(device_scale_factor_);
3721 } 3721 }
3722 } 3722 }
3723 3723
3724 } // namespace content 3724 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698