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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 if (command_line.HasSwitch(switches::kDefaultTileHeight)) | 539 if (command_line.HasSwitch(switches::kDefaultTileHeight)) |
540 prefs.default_tile_height = | 540 prefs.default_tile_height = |
541 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); | 541 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); |
542 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) | 542 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) |
543 prefs.max_untiled_layer_width = | 543 prefs.max_untiled_layer_width = |
544 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); | 544 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); |
545 if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight)) | 545 if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight)) |
546 prefs.max_untiled_layer_height = | 546 prefs.max_untiled_layer_height = |
547 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerHeight, 1); | 547 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerHeight, 1); |
548 | 548 |
| 549 if (gfx::Screen::IsDIPEnabled()) { |
| 550 // Only apply when using DIP coordinate system as this setting interferes |
| 551 // with fixed layout mode. |
| 552 prefs.apply_default_device_scale_factor_in_compositor = true; |
| 553 } |
| 554 |
549 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); | 555 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); |
550 | 556 |
551 return prefs; | 557 return prefs; |
552 } | 558 } |
553 | 559 |
554 NavigationControllerImpl& WebContentsImpl::GetControllerImpl() { | 560 NavigationControllerImpl& WebContentsImpl::GetControllerImpl() { |
555 return controller_; | 561 return controller_; |
556 } | 562 } |
557 | 563 |
558 RenderViewHostManager* WebContentsImpl::GetRenderManagerForTesting() { | 564 RenderViewHostManager* WebContentsImpl::GetRenderManagerForTesting() { |
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2810 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2816 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2811 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2817 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2812 // Can be NULL during tests. | 2818 // Can be NULL during tests. |
2813 if (rwh_view) | 2819 if (rwh_view) |
2814 rwh_view->SetSize(GetView()->GetContainerSize()); | 2820 rwh_view->SetSize(GetView()->GetContainerSize()); |
2815 } | 2821 } |
2816 | 2822 |
2817 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2823 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
2818 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2824 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
2819 } | 2825 } |
OLD | NEW |