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

Unified Diff: chrome/browser/ui/startup/bad_flags_prompt.cc

Issue 857123002: Disable Win32k renderer lockdown if DirectWrite is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cloudprint Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/bad_flags_prompt.cc
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc
index 4b594970f396c902004353f393e31a3fd483e758..217a59d13cdc21dc40d1befef3f578caef9701fd 100644
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -27,6 +27,10 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#if defined(OS_WIN)
jam 2015/01/22 17:00:15 nit: here and in other places, you don't need the
+#include "ui/gfx/switches.h"
+#endif
+
namespace chrome {
void ShowBadFlagsPrompt(Browser* browser) {
@@ -36,9 +40,11 @@ void ShowBadFlagsPrompt(Browser* browser) {
return;
// Unsupported flags for which to display a warning that "stability and
- // security will suffer".
+ // security will suffer". In reverse order of severity - most serious
+ // switches should be nearer the top.
static const char* kBadFlags[] = {
// These flags disable sandbox-related security.
+ switches::kNoSandbox,
switches::kDisableGpuSandbox,
switches::kDisableSeccompFilterSandbox,
switches::kDisableSetuidSandbox,
@@ -46,7 +52,6 @@ void ShowBadFlagsPrompt(Browser* browser) {
#if !defined(DISABLE_NACL)
switches::kNaClDangerousNoSandboxNonSfi,
#endif
- switches::kNoSandbox,
switches::kSingleProcess,
// These flags disable or undermine the Same Origin Policy.
@@ -77,18 +82,34 @@ void ShowBadFlagsPrompt(Browser* browser) {
NULL
};
+ std::string warning_switch;
+
+ base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+
+#if defined(OS_WIN)
+ if (switches::IsWin32kRendererLockdownEnabled(true) &&
+ cmd_line->HasSwitch(switches::kDisableDirectWrite)) {
+ warning_switch = switches::kDisableDirectWrite;
+ }
+#endif
+
for (const char** flag = kBadFlags; *flag; ++flag) {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) {
- SimpleAlertInfoBarDelegate::Create(
- InfoBarService::FromWebContents(web_contents),
- infobars::InfoBarDelegate::kNoIconID,
- l10n_util::GetStringFUTF16(IDS_BAD_FLAGS_WARNING_MESSAGE,
- base::UTF8ToUTF16(
- std::string("--") + *flag)),
- false);
- return;
+ if (cmd_line->HasSwitch(*flag)) {
+ warning_switch = *flag;
+ break;
}
}
+
+ if (warning_switch.empty())
+ return;
+
+ SimpleAlertInfoBarDelegate::Create(
+ InfoBarService::FromWebContents(web_contents),
+ infobars::InfoBarDelegate::kNoIconID,
+ l10n_util::GetStringFUTF16(
+ IDS_BAD_FLAGS_WARNING_MESSAGE,
+ base::UTF8ToUTF16(std::string("--") + warning_switch)),
+ false);
}
void MaybeShowInvalidUserDataDirWarningDialog() {

Powered by Google App Engine
This is Rietveld 408576698