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

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

Issue 1571833002: Add popup layout tests with device scale factor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698