| 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 if (rvh->GetView()) { | 543 if (rvh->GetView()) { |
| 544 gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow( | 544 gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow( |
| 545 rvh->GetView()->GetNativeView()); | 545 rvh->GetView()->GetNativeView()); |
| 546 prefs.default_device_scale_factor = | 546 prefs.default_device_scale_factor = |
| 547 static_cast<int>(monitor.device_scale_factor()); | 547 static_cast<int>(monitor.device_scale_factor()); |
| 548 } else { | 548 } else { |
| 549 prefs.default_device_scale_factor = | 549 prefs.default_device_scale_factor = |
| 550 gfx::Monitor::GetDefaultDeviceScaleFactor();; | 550 gfx::Monitor::GetDefaultDeviceScaleFactor();; |
| 551 } | 551 } |
| 552 #endif | 552 #endif |
| 553 prefs.force_enable_page_scale = |
| 554 command_line.HasSwitch(switches::kEnablePinch); |
| 553 | 555 |
| 554 if (command_line.HasSwitch(switches::kDefaultTileWidth)) | 556 if (command_line.HasSwitch(switches::kDefaultTileWidth)) |
| 555 prefs.default_tile_width = | 557 prefs.default_tile_width = |
| 556 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); | 558 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); |
| 557 if (command_line.HasSwitch(switches::kDefaultTileHeight)) | 559 if (command_line.HasSwitch(switches::kDefaultTileHeight)) |
| 558 prefs.default_tile_height = | 560 prefs.default_tile_height = |
| 559 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); | 561 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); |
| 560 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) | 562 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) |
| 561 prefs.max_untiled_layer_width = | 563 prefs.max_untiled_layer_width = |
| 562 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); | 564 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); |
| (...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3037 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3039 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 3038 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 3040 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 3039 // Can be NULL during tests. | 3041 // Can be NULL during tests. |
| 3040 if (rwh_view) | 3042 if (rwh_view) |
| 3041 rwh_view->SetSize(GetView()->GetContainerSize()); | 3043 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 3042 } | 3044 } |
| 3043 | 3045 |
| 3044 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 3046 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 3045 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 3047 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 3046 } | 3048 } |
| OLD | NEW |