Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 23a03d9b75fac5e2fd7bb91fa7001bfe8296fbcc..474a99470289d48e4695af5dbc99722eb09bd1d7 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -970,6 +970,26 @@ void WebContentsImpl::UpdateZoomIfNecessary(const std::string& scheme, |
| UpdateZoom(level); |
| } |
| +void WebContentsImpl::UpdateDeviceScaleFactor(double device_scale_factor) { |
| + SendPageMessage( |
| + new PageMsg_SetDeviceScaleFactor(MSG_ROUTING_NONE, device_scale_factor)); |
|
oshima
2016/07/07 22:45:43
Doesn't a oop frame receive ScreenInfo? When dsf c
wjmaclean
2016/07/08 17:38:33
The OOP frame is informed, but in a sort of round-
|
| +} |
| + |
| +double WebContentsImpl::DefaultDeviceScaleFactor() { |
| + // TODO(wjmaclean): is it simpler to just remember the value from the last |
| + // call to UpdateDeviceScaleFactor()? It's perhaps not the sort of state we |
| + // expect WebContents to be hanging on to. |
| + RenderWidgetHostViewBase* rwhv = |
| + static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| + if (rwhv) { |
| + blink::WebScreenInfo screen_info; |
| + rwhv->GetScreenInfo(&screen_info); |
| + return screen_info.deviceScaleFactor; |
| + } |
| + |
| + return RenderWidgetHostDelegate::DefaultDeviceScaleFactor(); |
|
oshima
2016/07/07 22:45:43
web content's view should also knows about the cur
wjmaclean
2016/07/08 17:38:33
You mean WebContentsView? I looked there but didn'
|
| +} |
| + |
| WebUI* WebContentsImpl::CreateSubframeWebUI(const GURL& url, |
| const std::string& frame_name) { |
| DCHECK(!frame_name.empty()); |