Chromium Code Reviews| 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 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" |
| 11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_number_conversions.h" | |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "base/time.h" | 15 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 16 #include "content/browser/child_process_security_policy_impl.h" | 17 #include "content/browser/child_process_security_policy_impl.h" |
| 17 #include "content/browser/debugger/devtools_manager_impl.h" | 18 #include "content/browser/debugger/devtools_manager_impl.h" |
| 18 #include "content/browser/download/download_stats.h" | 19 #include "content/browser/download/download_stats.h" |
| 19 #include "content/browser/download/save_package.h" | 20 #include "content/browser/download/save_package.h" |
| 20 #include "content/browser/gpu/gpu_data_manager_impl.h" | 21 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 21 #include "content/browser/gpu/gpu_process_host.h" | 22 #include "content/browser/gpu/gpu_process_host.h" |
| 22 #include "content/browser/host_zoom_map_impl.h" | 23 #include "content/browser/host_zoom_map_impl.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 450 // chrome-devtools: pages (unless it's specifically allowed). | 451 // chrome-devtools: pages (unless it's specifically allowed). |
| 451 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || | 452 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || |
| 452 url.SchemeIs(chrome::kChromeUIScheme) || | 453 url.SchemeIs(chrome::kChromeUIScheme) || |
| 453 (url.SchemeIs(chrome::kAboutScheme) && | 454 (url.SchemeIs(chrome::kAboutScheme) && |
| 454 url.spec() != chrome::kAboutBlankURL)) && | 455 url.spec() != chrome::kAboutBlankURL)) && |
| 455 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { | 456 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { |
| 456 prefs.accelerated_compositing_enabled = false; | 457 prefs.accelerated_compositing_enabled = false; |
| 457 prefs.accelerated_2d_canvas_enabled = false; | 458 prefs.accelerated_2d_canvas_enabled = false; |
| 458 } | 459 } |
| 459 | 460 |
| 461 int default_device_scale_factor; | |
| 462 base::StringToInt(command_line.GetSwitchValueASCII( | |
| 463 switches::kDefaultDeviceScaleFactor), | |
|
darin (slow to review)
2012/02/29 22:15:06
nit: indent parameter to GetSwitchValueASCII so it
tdresser
2012/03/01 14:05:11
Done.
| |
| 464 &default_device_scale_factor); | |
| 465 | |
| 466 prefs.default_device_scale_factor = default_device_scale_factor; | |
| 467 | |
| 460 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, &prefs); | 468 content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, &prefs); |
| 461 | 469 |
| 462 return prefs; | 470 return prefs; |
| 463 } | 471 } |
| 464 | 472 |
| 465 NavigationControllerImpl& TabContents::GetControllerImpl() { | 473 NavigationControllerImpl& TabContents::GetControllerImpl() { |
| 466 return controller_; | 474 return controller_; |
| 467 } | 475 } |
| 468 | 476 |
| 469 RenderViewHostManager* TabContents::GetRenderManagerForTesting() { | 477 RenderViewHostManager* TabContents::GetRenderManagerForTesting() { |
| (...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2472 save_info, | 2480 save_info, |
| 2473 this); | 2481 this); |
| 2474 } | 2482 } |
| 2475 | 2483 |
| 2476 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2484 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2477 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2485 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2478 // Can be NULL during tests. | 2486 // Can be NULL during tests. |
| 2479 if (rwh_view) | 2487 if (rwh_view) |
| 2480 rwh_view->SetSize(GetView()->GetContainerSize()); | 2488 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2481 } | 2489 } |
| OLD | NEW |