Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "content/public/common/content_switches.h" | 5 #include "content/public/common/content_switches.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #if defined(OS_WIN) | |
| 10 #include "base/win/windows_version.h" | |
| 11 #include "ui/gfx/switches.h" | |
| 12 #endif | |
| 9 | 13 |
| 10 namespace switches { | 14 namespace switches { |
| 11 | 15 |
| 12 // The number of MSAA samples for canvas2D. Requires MSAA support by GPU to | 16 // The number of MSAA samples for canvas2D. Requires MSAA support by GPU to |
| 13 // have an effect. 0 disables MSAA. | 17 // have an effect. 0 disables MSAA. |
| 14 const char kAcceleratedCanvas2dMSAASampleCount[] = "canvas-msaa-sample-count"; | 18 const char kAcceleratedCanvas2dMSAASampleCount[] = "canvas-msaa-sample-count"; |
| 15 | 19 |
| 16 // By default, file:// URIs cannot read other file:// URIs. This is an | 20 // By default, file:// URIs cannot read other file:// URIs. This is an |
| 17 // override for developers who need the old behavior for testing. | 21 // override for developers who need the old behavior for testing. |
| 18 const char kAllowFileAccessFromFiles[] = "allow-file-access-from-files"; | 22 const char kAllowFileAccessFromFiles[] = "allow-file-access-from-files"; |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 954 // clashes between different instances of Chrome. | 958 // clashes between different instances of Chrome. |
| 955 const char kFontCacheSharedMemSuffix[] = "font-cache-shared-mem-suffix"; | 959 const char kFontCacheSharedMemSuffix[] = "font-cache-shared-mem-suffix"; |
| 956 #endif | 960 #endif |
| 957 | 961 |
| 958 #if defined(ENABLE_PLUGINS) | 962 #if defined(ENABLE_PLUGINS) |
| 959 // Enables the plugin power saver feature. | 963 // Enables the plugin power saver feature. |
| 960 const char kEnablePluginPowerSaver[] = "enable-plugin-power-saver"; | 964 const char kEnablePluginPowerSaver[] = "enable-plugin-power-saver"; |
| 961 #endif | 965 #endif |
| 962 | 966 |
| 963 #if defined(OS_WIN) | 967 #if defined(OS_WIN) |
| 964 bool IsWin32kRendererLockdownEnabled() { | 968 bool IsWin32kRendererLockdownEnabled(bool ignore_directwrite) { |
|
cpu_(ooo_6.6-7.5)
2015/01/22 01:22:02
not loving this contract, I mean interface.
| |
| 965 const std::string group_name = | 969 const std::string group_name = |
| 966 base::FieldTrialList::FindFullName("Win32kLockdown"); | 970 base::FieldTrialList::FindFullName("Win32kLockdown"); |
| 971 if (base::win::GetVersion() < base::win::VERSION_WIN8) | |
| 972 return false; | |
| 967 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 973 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 974 if (!ignore_directwrite && cmd_line->HasSwitch(switches::kDisableDirectWrite)) | |
| 975 return false; | |
| 968 if (cmd_line->HasSwitch(kEnableWin32kRendererLockDown)) | 976 if (cmd_line->HasSwitch(kEnableWin32kRendererLockDown)) |
| 969 return true; | 977 return true; |
| 970 if (cmd_line->HasSwitch(kDisableWin32kRendererLockDown)) | 978 if (cmd_line->HasSwitch(kDisableWin32kRendererLockDown)) |
| 971 return false; | 979 return false; |
| 972 // Default. | 980 // Default. |
| 973 return group_name == "Enabled"; | 981 return group_name == "Enabled"; |
| 974 } | 982 } |
| 975 #endif | 983 #endif |
| 976 | 984 |
| 977 // Don't dump stuff here, follow the same order as the header. | 985 // Don't dump stuff here, follow the same order as the header. |
| 978 | 986 |
| 979 } // namespace switches | 987 } // namespace switches |
| OLD | NEW |