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 | |
555 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); | 549 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs); |
556 | 550 |
557 return prefs; | 551 return prefs; |
558 } | 552 } |
559 | 553 |
560 NavigationControllerImpl& WebContentsImpl::GetControllerImpl() { | 554 NavigationControllerImpl& WebContentsImpl::GetControllerImpl() { |
561 return controller_; | 555 return controller_; |
562 } | 556 } |
563 | 557 |
564 RenderViewHostManager* WebContentsImpl::GetRenderManagerForTesting() { | 558 RenderViewHostManager* WebContentsImpl::GetRenderManagerForTesting() { |
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2816 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2810 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2817 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2811 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2818 // Can be NULL during tests. | 2812 // Can be NULL during tests. |
2819 if (rwh_view) | 2813 if (rwh_view) |
2820 rwh_view->SetSize(GetView()->GetContainerSize()); | 2814 rwh_view->SetSize(GetView()->GetContainerSize()); |
2821 } | 2815 } |
2822 | 2816 |
2823 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2817 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
2824 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2818 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
2825 } | 2819 } |
OLD | NEW |