Commit 8a9ca863 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

[Dynamic Refresh] Guard behind a feature flag

BUG=881371,737995
R=sky,robliao

Change-Id: I9798f20415975c7f98528b2f746aaffe6a66af1e
Reviewed-on: https://chromium-review.googlesource.com/c/1316834
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609065}
parent 54da9285
...@@ -65,7 +65,8 @@ void MaterialDesignController::Initialize() { ...@@ -65,7 +65,8 @@ void MaterialDesignController::Initialize() {
// When the mode is not explicitly forced, platforms vary as to the default // When the mode is not explicitly forced, platforms vary as to the default
// behavior. // behavior.
if (!touch && (switch_value != switches::kTopChromeTouchUiDisabled)) { if (!touch && (switch_value != switches::kTopChromeTouchUiDisabled) &&
features::IsAutomaticUiAdjustmentsForTouchEnabled()) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// TabletModeClient's default state is in non-tablet mode. // TabletModeClient's default state is in non-tablet mode.
automatic_touch_ui_ = true; automatic_touch_ui_ = true;
......
...@@ -120,6 +120,11 @@ const base::Feature kPrecisionTouchpadScrollPhase{ ...@@ -120,6 +120,11 @@ const base::Feature kPrecisionTouchpadScrollPhase{
"PrecisionTouchpadScrollPhase", base::FEATURE_ENABLED_BY_DEFAULT}; "PrecisionTouchpadScrollPhase", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#if defined(OS_WIN) || defined(OS_CHROMEOS)
const base::Feature kEnableAutomaticUiAdjustmentsForTouch{
"EnableAutomaticUiAdjustmentsForTouch", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_WIN) || defined(OS_CHROMEOS)
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
// Enables stylus appearing as touch when in contact with digitizer. // Enables stylus appearing as touch when in contact with digitizer.
const base::Feature kDirectManipulationStylus = { const base::Feature kDirectManipulationStylus = {
...@@ -149,6 +154,15 @@ bool IsSingleProcessMash() { ...@@ -149,6 +154,15 @@ bool IsSingleProcessMash() {
return base::FeatureList::IsEnabled(features::kSingleProcessMash); return base::FeatureList::IsEnabled(features::kSingleProcessMash);
} }
bool IsAutomaticUiAdjustmentsForTouchEnabled() {
#if defined(OS_WIN) || defined(OS_CHROMEOS)
return base::FeatureList::IsEnabled(
features::kEnableAutomaticUiAdjustmentsForTouch);
#else
return false;
#endif
}
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// When enabled, the NSWindows for apps will be created in the app's process, // When enabled, the NSWindows for apps will be created in the app's process,
// and will forward input to the browser process. // and will forward input to the browser process.
......
...@@ -43,6 +43,10 @@ UI_BASE_EXPORT extern const base::Feature kTSFImeSupport; ...@@ -43,6 +43,10 @@ UI_BASE_EXPORT extern const base::Feature kTSFImeSupport;
UI_BASE_EXPORT bool IsUsingWMPointerForTouch(); UI_BASE_EXPORT bool IsUsingWMPointerForTouch();
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#if defined(OS_WIN) || defined(OS_CHROMEOS)
UI_BASE_EXPORT extern const base::Feature kEnableAutomaticUiAdjustmentsForTouch;
#endif // defined(OS_WIN) || defined(OS_CHROMEOS)
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus; UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus;
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) #endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
...@@ -68,6 +72,9 @@ UI_BASE_EXPORT bool IsMultiProcessMash(); ...@@ -68,6 +72,9 @@ UI_BASE_EXPORT bool IsMultiProcessMash();
// See //ash/README.md. // See //ash/README.md.
UI_BASE_EXPORT bool IsSingleProcessMash(); UI_BASE_EXPORT bool IsSingleProcessMash();
// Whether the UI may accommodate touch input in response to hardware changes.
UI_BASE_EXPORT bool IsAutomaticUiAdjustmentsForTouchEnabled();
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
UI_BASE_EXPORT extern const base::Feature kHostWindowsInAppShimProcess; UI_BASE_EXPORT extern const base::Feature kHostWindowsInAppShimProcess;
......
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