| 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 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 } | 1807 } |
| 1808 | 1808 |
| 1809 WebPreferences TabContents::GetWebkitPrefs() { | 1809 WebPreferences TabContents::GetWebkitPrefs() { |
| 1810 WebPreferences web_prefs = | 1810 WebPreferences web_prefs = |
| 1811 content::GetContentClient()->browser()->GetWebkitPrefs( | 1811 content::GetContentClient()->browser()->GetWebkitPrefs( |
| 1812 render_view_host()->process()->browser_context(), false); | 1812 render_view_host()->process()->browser_context(), false); |
| 1813 | 1813 |
| 1814 // Force accelerated compositing and 2d canvas off for chrome:, about: and | 1814 // Force accelerated compositing and 2d canvas off for chrome:, about: and |
| 1815 // chrome-devtools: pages (unless it's specifically allowed). | 1815 // chrome-devtools: pages (unless it's specifically allowed). |
| 1816 if ((GetURL().SchemeIs(chrome::kChromeDevToolsScheme) || | 1816 if ((GetURL().SchemeIs(chrome::kChromeDevToolsScheme) || |
| 1817 #if !defined(TOUCH_UI) |
| 1818 // Allow accelerated compositing for keyboard and log in screen. |
| 1817 GetURL().SchemeIs(chrome::kChromeUIScheme) || | 1819 GetURL().SchemeIs(chrome::kChromeUIScheme) || |
| 1820 #endif |
| 1818 GetURL().SchemeIs(chrome::kAboutScheme)) && | 1821 GetURL().SchemeIs(chrome::kAboutScheme)) && |
| 1819 !web_prefs.allow_webui_compositing) { | 1822 !web_prefs.allow_webui_compositing) { |
| 1820 web_prefs.accelerated_compositing_enabled = false; | 1823 web_prefs.accelerated_compositing_enabled = false; |
| 1821 web_prefs.accelerated_2d_canvas_enabled = false; | 1824 web_prefs.accelerated_2d_canvas_enabled = false; |
| 1822 } | 1825 } |
| 1823 | 1826 |
| 1824 #if defined(OS_MACOSX) | 1827 #if defined(OS_MACOSX) |
| 1825 // Disable accelerated compositing if IOSurface's are not supported, | 1828 // Disable accelerated compositing if IOSurface's are not supported, |
| 1826 // as is the case in 10.5. | 1829 // as is the case in 10.5. |
| 1827 if (!IOSurfaceSupport::Initialize()) | 1830 if (!IOSurfaceSupport::Initialize()) |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2012 } | 2015 } |
| 2013 | 2016 |
| 2014 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 2017 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
| 2015 render_manager_.SwapInRenderViewHost(rvh); | 2018 render_manager_.SwapInRenderViewHost(rvh); |
| 2016 } | 2019 } |
| 2017 | 2020 |
| 2018 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2021 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2019 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2022 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2020 rwh_view->SetSize(view()->GetContainerSize()); | 2023 rwh_view->SetSize(view()->GetContainerSize()); |
| 2021 } | 2024 } |
| OLD | NEW |