summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 21:24:45 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 21:24:45 +0000
commitf553c3826590d980973269d17be1f09e075f98af (patch)
tree8b776d47367becdb4a8941fd7f2bdaab3ec9e239 /chrome/browser/renderer_host
parent865394df590aabeeb15db51ac159f165fd6d9c9c (diff)
downloadchromium_src-f553c3826590d980973269d17be1f09e075f98af.zip
chromium_src-f553c3826590d980973269d17be1f09e075f98af.tar.gz
chromium_src-f553c3826590d980973269d17be1f09e075f98af.tar.bz2
Added group policy for disabling all client-side 3D APIs in Chromium
(in particular, WebGL and Pepper 3D). This has been hooked up through a new command-line argument (--disable-3d-apis) orthogonal to the existing ones, so that further changes to those command line arguments will not accidentally regress the group policy support. Tested in the following ways: - Verified that --disable-3d-apis disables WebGL and Pepper 3D support on Mac OS X. - Verified that specifying the Disable3DAPIs policy via a JSON file disables WebGL on Linux. - Ran unit_tests and verified that there were no failures introduced. BUG=64806 TEST=ConfigurationPolicyPrefStoreBooleanTest Review URL: http://codereview.chromium.org/5991003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 677bb94..d916bcc 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -596,6 +596,14 @@ void BrowserRenderProcessHost::AppendRendererCommandLine(
if (!profile.empty())
command_line->AppendSwitchASCII(switches::kLoginProfile, profile);
#endif
+
+ PrefService* prefs = profile()->GetPrefs();
+ // Currently this pref is only registered if applied via a policy.
+ if (prefs->HasPrefPath(prefs::kDisable3DAPIs) &&
+ prefs->GetBoolean(prefs::kDisable3DAPIs)) {
+ // Turn this policy into a command line switch.
+ command_line->AppendSwitch(switches::kDisable3DAPIs);
+ }
}
void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
@@ -698,7 +706,8 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
switches::kDisableFileSystem,
switches::kPpapiOutOfProcess,
switches::kEnablePrintPreview,
- switches::kEnableCrxlessWebApps
+ switches::kEnableCrxlessWebApps,
+ switches::kDisable3DAPIs
};
renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames,
arraysize(kSwitchNames));