OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 | 1795 |
1796 WebPreferences TabContents::GetWebkitPrefs() { | 1796 WebPreferences TabContents::GetWebkitPrefs() { |
1797 WebPreferences web_prefs = | 1797 WebPreferences web_prefs = |
1798 content::GetContentClient()->browser()->GetWebkitPrefs( | 1798 content::GetContentClient()->browser()->GetWebkitPrefs( |
1799 render_view_host()->process()->browser_context(), false); | 1799 render_view_host()->process()->browser_context(), false); |
1800 | 1800 |
1801 // Force accelerated compositing and 2d canvas off for chrome:, about: and | 1801 // Force accelerated compositing and 2d canvas off for chrome:, about: and |
1802 // chrome-devtools: pages (unless it's specifically allowed). | 1802 // chrome-devtools: pages (unless it's specifically allowed). |
1803 if ((GetURL().SchemeIs(chrome::kChromeDevToolsScheme) || | 1803 if ((GetURL().SchemeIs(chrome::kChromeDevToolsScheme) || |
1804 GetURL().SchemeIs(chrome::kChromeUIScheme) || | 1804 GetURL().SchemeIs(chrome::kChromeUIScheme) || |
1805 (GetURL().SchemeIs(chrome::kAboutScheme) && | 1805 GetURL().SchemeIs(chrome::kAboutScheme)) && |
1806 GetURL().spec() != chrome::kAboutBlankURL)) && | |
1807 !web_prefs.allow_webui_compositing) { | 1806 !web_prefs.allow_webui_compositing) { |
1808 web_prefs.accelerated_compositing_enabled = false; | 1807 web_prefs.accelerated_compositing_enabled = false; |
1809 web_prefs.accelerated_2d_canvas_enabled = false; | 1808 web_prefs.accelerated_2d_canvas_enabled = false; |
1810 } | 1809 } |
1811 | 1810 |
1812 #if defined(OS_MACOSX) | 1811 #if defined(OS_MACOSX) |
1813 // Disable accelerated compositing if IOSurface's are not supported, | 1812 // Disable accelerated compositing if IOSurface's are not supported, |
1814 // as is the case in 10.5. | 1813 // as is the case in 10.5. |
1815 if (!IOSurfaceSupport::Initialize()) | 1814 if (!IOSurfaceSupport::Initialize()) |
1816 web_prefs.accelerated_compositing_enabled = false; | 1815 web_prefs.accelerated_compositing_enabled = false; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 } | 1999 } |
2001 | 2000 |
2002 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 2001 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
2003 render_manager_.SwapInRenderViewHost(rvh); | 2002 render_manager_.SwapInRenderViewHost(rvh); |
2004 } | 2003 } |
2005 | 2004 |
2006 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2005 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2007 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2006 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2008 rwh_view->SetSize(view()->GetContainerSize()); | 2007 rwh_view->SetSize(view()->GetContainerSize()); |
2009 } | 2008 } |
OLD | NEW |