| 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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2172 RenderWidget::convertViewportToWindow(rect); | 2172 RenderWidget::convertViewportToWindow(rect); |
| 2173 } | 2173 } |
| 2174 | 2174 |
| 2175 gfx::RectF RenderViewImpl::ElementBoundsInWindow( | 2175 gfx::RectF RenderViewImpl::ElementBoundsInWindow( |
| 2176 const blink::WebElement& element) { | 2176 const blink::WebElement& element) { |
| 2177 blink::WebRect bounding_box_in_window = element.boundsInViewport(); | 2177 blink::WebRect bounding_box_in_window = element.boundsInViewport(); |
| 2178 convertViewportToWindow(&bounding_box_in_window); | 2178 convertViewportToWindow(&bounding_box_in_window); |
| 2179 return gfx::RectF(bounding_box_in_window); | 2179 return gfx::RectF(bounding_box_in_window); |
| 2180 } | 2180 } |
| 2181 | 2181 |
| 2182 float RenderViewImpl::GetDeviceScaleFactorForTest() const { |
| 2183 return device_scale_factor_; |
| 2184 } |
| 2185 |
| 2182 void RenderViewImpl::didChangeIcon(WebLocalFrame* frame, | 2186 void RenderViewImpl::didChangeIcon(WebLocalFrame* frame, |
| 2183 WebIconURL::Type icon_type) { | 2187 WebIconURL::Type icon_type) { |
| 2184 if (frame->parent()) | 2188 if (frame->parent()) |
| 2185 return; | 2189 return; |
| 2186 | 2190 |
| 2187 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); | 2191 WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type); |
| 2188 std::vector<FaviconURL> urls; | 2192 std::vector<FaviconURL> urls; |
| 2189 for (size_t i = 0; i < icon_urls.size(); i++) { | 2193 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 2190 std::vector<gfx::Size> sizes; | 2194 std::vector<gfx::Size> sizes; |
| 2191 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 2195 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| (...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3713 if (IsUseZoomForDSFEnabled()) { | 3717 if (IsUseZoomForDSFEnabled()) { |
| 3714 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3718 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3715 } else { | 3719 } else { |
| 3716 webview()->setDeviceScaleFactor(device_scale_factor_); | 3720 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3717 } | 3721 } |
| 3718 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3722 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3719 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3723 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3720 } | 3724 } |
| 3721 | 3725 |
| 3722 } // namespace content | 3726 } // namespace content |
| OLD | NEW |