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 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 RenderWidget::convertViewportToWindow(rect); | 2177 RenderWidget::convertViewportToWindow(rect); |
2178 } | 2178 } |
2179 | 2179 |
2180 gfx::RectF RenderViewImpl::ElementBoundsInWindow( | 2180 gfx::RectF RenderViewImpl::ElementBoundsInWindow( |
2181 const blink::WebElement& element) { | 2181 const blink::WebElement& element) { |
2182 blink::WebRect bounding_box_in_window = element.boundsInViewport(); | 2182 blink::WebRect bounding_box_in_window = element.boundsInViewport(); |
2183 convertViewportToWindow(&bounding_box_in_window); | 2183 convertViewportToWindow(&bounding_box_in_window); |
2184 return gfx::RectF(bounding_box_in_window); | 2184 return gfx::RectF(bounding_box_in_window); |
2185 } | 2185 } |
2186 | 2186 |
| 2187 float RenderViewImpl::GetDeviceScaleFactorForTest() const { |
| 2188 return device_scale_factor_; |
| 2189 } |
| 2190 |
2187 void RenderViewImpl::didChangeIcon(WebLocalFrame* frame, | 2191 void RenderViewImpl::didChangeIcon(WebLocalFrame* frame, |
2188 WebIconURL::Type icon_type) { | 2192 WebIconURL::Type icon_type) { |
2189 if (frame->parent()) | 2193 if (frame->parent()) |
2190 return; | 2194 return; |
2191 | 2195 |
2192 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); | 2196 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); |
2193 std::vector<FaviconURL> urls; | 2197 std::vector<FaviconURL> urls; |
2194 for (size_t i = 0; i < icon_urls.size(); i++) { | 2198 for (size_t i = 0; i < icon_urls.size(); i++) { |
2195 std::vector<gfx::Size> sizes; | 2199 std::vector<gfx::Size> sizes; |
2196 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 2200 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3724 if (IsUseZoomForDSFEnabled()) { | 3728 if (IsUseZoomForDSFEnabled()) { |
3725 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3729 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3726 } else { | 3730 } else { |
3727 webview()->setDeviceScaleFactor(device_scale_factor_); | 3731 webview()->setDeviceScaleFactor(device_scale_factor_); |
3728 } | 3732 } |
3729 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3733 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3730 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3734 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3731 } | 3735 } |
3732 | 3736 |
3733 } // namespace content | 3737 } // namespace content |
OLD | NEW |