| Index: content/common/content_switches_internal.cc
|
| diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc
|
| index 76d877224a4ef9d076cf8bfe0f0b7d498a18d57e..68b24c477078bce0bc060276cbf74758908a651d 100644
|
| --- a/content/common/content_switches_internal.cc
|
| +++ b/content/common/content_switches_internal.cc
|
| @@ -5,10 +5,12 @@
|
| #include "content/common/content_switches_internal.h"
|
|
|
| #include "base/command_line.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "content/public/common/content_switches.h"
|
|
|
| #if defined(OS_WIN)
|
| #include "base/win/windows_version.h"
|
| +#include "ui/gfx/win/direct_write.h"
|
| #endif
|
|
|
| namespace content {
|
| @@ -31,4 +33,23 @@ bool IsPinchToZoomEnabled() {
|
| #endif
|
| }
|
|
|
| +#if defined(OS_WIN)
|
| +
|
| +bool IsWin32kRendererLockdownEnabled() {
|
| + const std::string group_name =
|
| + base::FieldTrialList::FindFullName("Win32kLockdown");
|
| + if (base::win::GetVersion() < base::win::VERSION_WIN8)
|
| + return false;
|
| + if (!gfx::win::ShouldUseDirectWrite())
|
| + return false;
|
| + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
|
| + if (cmd_line->HasSwitch(switches::kEnableWin32kRendererLockDown))
|
| + return true;
|
| + if (cmd_line->HasSwitch(switches::kDisableWin32kRendererLockDown))
|
| + return false;
|
| + // Default.
|
| + return group_name == "Enabled";
|
| +}
|
| +#endif
|
| +
|
| } // namespace content
|
|
|