Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 233093006: Stop disabling force_compositing_mode for background RenderViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: background: test Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after
2226 } 2226 }
2227 2227
2228 AccessTokenStore* ChromeContentBrowserClient::CreateAccessTokenStore() { 2228 AccessTokenStore* ChromeContentBrowserClient::CreateAccessTokenStore() {
2229 return new ChromeAccessTokenStore(); 2229 return new ChromeAccessTokenStore();
2230 } 2230 }
2231 2231
2232 bool ChromeContentBrowserClient::IsFastShutdownPossible() { 2232 bool ChromeContentBrowserClient::IsFastShutdownPossible() {
2233 return true; 2233 return true;
2234 } 2234 }
2235 2235
2236 bool ChromeContentBrowserClient::IsRenderViewHostForBackground(
2237 RenderViewHost* rvh) {
2238 WebContents* web_contents = WebContents::FromRenderViewHost(rvh);
2239 extensions::ViewType view_type = extensions::GetViewType(web_contents);
2240 bool background =
2241 view_type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS ||
2242 view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE;
2243 if (background)
2244 LOG(ERROR) << "DISABLING FORCE COMPOSITING MODE";
2245 return background;
2246 }
2247
2236 void ChromeContentBrowserClient::OverrideWebkitPrefs( 2248 void ChromeContentBrowserClient::OverrideWebkitPrefs(
2237 RenderViewHost* rvh, const GURL& url, WebPreferences* web_prefs) { 2249 RenderViewHost* rvh, const GURL& url, WebPreferences* web_prefs) {
2238 Profile* profile = Profile::FromBrowserContext( 2250 Profile* profile = Profile::FromBrowserContext(
2239 rvh->GetProcess()->GetBrowserContext()); 2251 rvh->GetProcess()->GetBrowserContext());
2240 PrefService* prefs = profile->GetPrefs(); 2252 PrefService* prefs = profile->GetPrefs();
2241 2253
2242 // Fill per-script font preferences. These are not registered on Android 2254 // Fill per-script font preferences. These are not registered on Android
2243 // - http://crbug.com/308033. 2255 // - http://crbug.com/308033.
2244 #if !defined(OS_ANDROID) 2256 #if !defined(OS_ANDROID)
2245 FillFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap, 2257 FillFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 // webview tags as well as hosts that happen to match the id of an 2368 // webview tags as well as hosts that happen to match the id of an
2357 // installed extension would get the wrong preferences. 2369 // installed extension would get the wrong preferences.
2358 if (site_url.SchemeIs(extensions::kExtensionScheme)) { 2370 if (site_url.SchemeIs(extensions::kExtensionScheme)) {
2359 extension_webkit_preferences::SetPreferences( 2371 extension_webkit_preferences::SetPreferences(
2360 extension, view_type, web_prefs); 2372 extension, view_type, web_prefs);
2361 } 2373 }
2362 } 2374 }
2363 2375
2364 if (view_type == extensions::VIEW_TYPE_NOTIFICATION) { 2376 if (view_type == extensions::VIEW_TYPE_NOTIFICATION) {
2365 web_prefs->allow_scripts_to_close_windows = true; 2377 web_prefs->allow_scripts_to_close_windows = true;
2366 } else if (view_type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS) {
2367 // Disable all kinds of acceleration for background pages.
2368 // See http://crbug.com/96005 and http://crbug.com/96006
2369 web_prefs->force_compositing_mode = false;
2370 web_prefs->accelerated_compositing_enabled = false;
2371 } 2378 }
2372 2379
2373 #if defined(OS_CHROMEOS) 2380 #if defined(OS_CHROMEOS)
2374 // Override the default of suppressing HW compositing for WebUI pages for the 2381 // Override the default of suppressing HW compositing for WebUI pages for the
2375 // file manager, which is implemented using WebUI but wants HW acceleration 2382 // file manager, which is implemented using WebUI but wants HW acceleration
2376 // for video decode & render. 2383 // for video decode & render.
2377 if (url.SchemeIs(extensions::kExtensionScheme) && 2384 if (url.SchemeIs(extensions::kExtensionScheme) &&
2378 url.host() == file_manager::kFileManagerAppId) { 2385 url.host() == file_manager::kFileManagerAppId) {
2379 web_prefs->accelerated_compositing_enabled = true; 2386 web_prefs->accelerated_compositing_enabled = true;
2380 web_prefs->accelerated_2d_canvas_enabled = true; 2387 web_prefs->accelerated_2d_canvas_enabled = true;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 switches::kDisableWebRtcEncryption, 2766 switches::kDisableWebRtcEncryption,
2760 }; 2767 };
2761 to_command_line->CopySwitchesFrom(from_command_line, 2768 to_command_line->CopySwitchesFrom(from_command_line,
2762 kWebRtcDevSwitchNames, 2769 kWebRtcDevSwitchNames,
2763 arraysize(kWebRtcDevSwitchNames)); 2770 arraysize(kWebRtcDevSwitchNames));
2764 } 2771 }
2765 } 2772 }
2766 #endif // defined(ENABLE_WEBRTC) 2773 #endif // defined(ENABLE_WEBRTC)
2767 2774
2768 } // namespace chrome 2775 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698