| 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 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 } | 1828 } |
| 1829 | 1829 |
| 1830 WebPreferences TabContents::GetWebkitPrefs() { | 1830 WebPreferences TabContents::GetWebkitPrefs() { |
| 1831 WebPreferences web_prefs = | 1831 WebPreferences web_prefs = |
| 1832 content::GetContentClient()->browser()->GetWebkitPrefs( | 1832 content::GetContentClient()->browser()->GetWebkitPrefs( |
| 1833 render_view_host()); | 1833 render_view_host()); |
| 1834 | 1834 |
| 1835 // Force accelerated compositing and 2d canvas off for chrome:, about: and | 1835 // Force accelerated compositing and 2d canvas off for chrome:, about: and |
| 1836 // chrome-devtools: pages (unless it's specifically allowed). | 1836 // chrome-devtools: pages (unless it's specifically allowed). |
| 1837 if ((GetURL().SchemeIs(chrome::kChromeDevToolsScheme) || | 1837 if ((GetURL().SchemeIs(chrome::kChromeDevToolsScheme) || |
| 1838 #if !defined(TOUCH_UI) | |
| 1839 // Allow accelerated compositing for keyboard and log in screen. | 1838 // Allow accelerated compositing for keyboard and log in screen. |
| 1840 GetURL().SchemeIs(chrome::kChromeUIScheme) || | 1839 GetURL().SchemeIs(chrome::kChromeUIScheme) || |
| 1841 #endif | |
| 1842 (GetURL().SchemeIs(chrome::kAboutScheme) && | 1840 (GetURL().SchemeIs(chrome::kAboutScheme) && |
| 1843 GetURL().spec() != chrome::kAboutBlankURL)) && | 1841 GetURL().spec() != chrome::kAboutBlankURL)) && |
| 1844 !web_prefs.allow_webui_compositing) { | 1842 !web_prefs.allow_webui_compositing) { |
| 1845 web_prefs.accelerated_compositing_enabled = false; | 1843 web_prefs.accelerated_compositing_enabled = false; |
| 1846 web_prefs.accelerated_2d_canvas_enabled = false; | 1844 web_prefs.accelerated_2d_canvas_enabled = false; |
| 1847 } | 1845 } |
| 1848 | 1846 |
| 1849 #if defined(TOUCH_UI) | |
| 1850 web_prefs.force_compositing_mode = true; | |
| 1851 #endif | |
| 1852 | |
| 1853 return web_prefs; | 1847 return web_prefs; |
| 1854 } | 1848 } |
| 1855 | 1849 |
| 1856 void TabContents::OnUserGesture() { | 1850 void TabContents::OnUserGesture() { |
| 1857 // Notify observers. | 1851 // Notify observers. |
| 1858 FOR_EACH_OBSERVER(TabContentsObserver, observers_, DidGetUserGesture()); | 1852 FOR_EACH_OBSERVER(TabContentsObserver, observers_, DidGetUserGesture()); |
| 1859 | 1853 |
| 1860 ResourceDispatcherHost* rdh = | 1854 ResourceDispatcherHost* rdh = |
| 1861 content::GetContentClient()->browser()->GetResourceDispatcherHost(); | 1855 content::GetContentClient()->browser()->GetResourceDispatcherHost(); |
| 1862 if (rdh) // NULL in unittests. | 1856 if (rdh) // NULL in unittests. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2030 | 2024 |
| 2031 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2025 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2032 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2026 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2033 rwh_view->SetSize(view()->GetContainerSize()); | 2027 rwh_view->SetSize(view()->GetContainerSize()); |
| 2034 } | 2028 } |
| 2035 | 2029 |
| 2036 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { | 2030 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { |
| 2037 return render_view_host() ? | 2031 return render_view_host() ? |
| 2038 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; | 2032 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; |
| 2039 } | 2033 } |
| OLD | NEW |