Commit 549aa8ae authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Remove feature flag for disabling Win10 custom titlebar

This flag was just for debugging so it is more appropriate as a
command line switch. Also, this function is called in hot code, and
feature flag queries are slow. A command line switch is safer to
cache; tests are allowed to enable or disable feature flags on the
fly, hence caching a feature flag lookup breaks this contract.

This allows for caching the result without breaking expectations.

Bug: 960913
Change-Id: Ibb9f9b7b7db7b9329984d71318c7488534e04f9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600494Reviewed-by: default avatarPatrick Monette <pmonette@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659125}
parent 88484baf
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "ui/native_theme/native_theme_win.h" #include "ui/native_theme/native_theme_win.h"
// Enables custom-drawing the titlebar and tabstrip background so that we can
// paint it various gray colors instead of the default #FFFFFF.
const base::Feature kWindows10CustomTitlebar{"Windows10CustomTitlebar",
base::FEATURE_ENABLED_BY_DEFAULT};
bool ShouldCustomDrawSystemTitlebar() { bool ShouldCustomDrawSystemTitlebar() {
// Cache flag lookup.
static const bool custom_titlebar_disabled =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableWindows10CustomTitlebar);
// TODO(bsep): We would like the custom-draw the titlebar in high-contrast // TODO(bsep): We would like the custom-draw the titlebar in high-contrast
// mode so that we can correctly draw the caption buttons on the left in RTL // mode so that we can correctly draw the caption buttons on the left in RTL
// mode. But they require a different style and color selection that isn't // mode. But they require a different style and color selection that isn't
// currently implemented. // currently implemented.
return !ui::NativeTheme::GetInstanceForNativeUi()->UsesHighContrastColors() && return !custom_titlebar_disabled &&
base::FeatureList::IsEnabled(kWindows10CustomTitlebar) && !ui::NativeTheme::GetInstanceForNativeUi()->UsesHighContrastColors() &&
base::win::GetVersion() >= base::win::Version::WIN10; base::win::GetVersion() >= base::win::Version::WIN10;
} }
...@@ -797,6 +797,10 @@ const char kMakeChromeDefault[] = "make-chrome-default"; ...@@ -797,6 +797,10 @@ const char kMakeChromeDefault[] = "make-chrome-default";
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
#if defined(OS_WIN) #if defined(OS_WIN)
// Disables custom-drawing the window titlebar on Windows 10.
const char kDisableWindows10CustomTitlebar[] =
"disable-windows10-custom-titlebar";
// Fallback to XPS. By default connector uses CDD. // Fallback to XPS. By default connector uses CDD.
const char kEnableCloudPrintXps[] = "enable-cloud-print-xps"; const char kEnableCloudPrintXps[] = "enable-cloud-print-xps";
......
...@@ -242,6 +242,7 @@ extern const char kMakeChromeDefault[]; ...@@ -242,6 +242,7 @@ extern const char kMakeChromeDefault[];
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
#if defined(OS_WIN) #if defined(OS_WIN)
extern const char kDisableWindows10CustomTitlebar[];
extern const char kEnableCloudPrintXps[]; extern const char kEnableCloudPrintXps[];
extern const char kEnableProfileShortcutManager[]; extern const char kEnableProfileShortcutManager[];
extern const char kHideIcons[]; extern const char kHideIcons[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment