Chromium Code Reviews| 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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3717 } | 3721 } |
| 3718 SendUpdateFaviconURL(urls); | 3722 SendUpdateFaviconURL(urls); |
| 3719 } | 3723 } |
| 3720 | 3724 |
| 3721 void RenderViewImpl::UpdateWebViewWithDeviceScaleFactor() { | 3725 void RenderViewImpl::UpdateWebViewWithDeviceScaleFactor() { |
| 3722 if (!webview()) | 3726 if (!webview()) |
| 3723 return; | 3727 return; |
| 3724 if (IsUseZoomForDSFEnabled()) { | 3728 if (IsUseZoomForDSFEnabled()) { |
| 3725 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3729 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3726 } else { | 3730 } else { |
| 3731 LOG(ERROR) << "Update Device Scale Factor:" << device_scale_factor_; | |
| 3727 webview()->setDeviceScaleFactor(device_scale_factor_); | 3732 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3733 LOG(ERROR) << "DSF=" << webview()->deviceScaleFactor(); | |
|
oshima
2016/01/08 22:27:55
this is deleted in next patch.
Noel Gordon
2016/01/09 03:23:50
Acknowledged.
| |
| 3728 } | 3734 } |
| 3729 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3735 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3730 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3736 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3731 } | 3737 } |
| 3732 | 3738 |
| 3733 } // namespace content | 3739 } // namespace content |
| OLD | NEW |