Skip to content

Commit 8a9ca86

Browse files
Robert LiaoCommit Bot
Robert Liao
authored and
Commit Bot
committed
[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 <[email protected]> Reviewed-by: Robert Liao <[email protected]> Reviewed-by: Scott Violet <[email protected]> Cr-Commit-Position: refs/heads/master@{#609065}
1 parent 54da928 commit 8a9ca86

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

ui/base/material_design/material_design_controller.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ void MaterialDesignController::Initialize() {
6565

6666
// When the mode is not explicitly forced, platforms vary as to the default
6767
// behavior.
68-
if (!touch && (switch_value != switches::kTopChromeTouchUiDisabled)) {
68+
if (!touch && (switch_value != switches::kTopChromeTouchUiDisabled) &&
69+
features::IsAutomaticUiAdjustmentsForTouchEnabled()) {
6970
#if defined(OS_CHROMEOS)
7071
// TabletModeClient's default state is in non-tablet mode.
7172
automatic_touch_ui_ = true;

ui/base/ui_base_features.cc

+14
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ const base::Feature kPrecisionTouchpadScrollPhase{
120120
"PrecisionTouchpadScrollPhase", base::FEATURE_ENABLED_BY_DEFAULT};
121121
#endif // defined(OS_WIN)
122122

123+
#if defined(OS_WIN) || defined(OS_CHROMEOS)
124+
const base::Feature kEnableAutomaticUiAdjustmentsForTouch{
125+
"EnableAutomaticUiAdjustmentsForTouch", base::FEATURE_ENABLED_BY_DEFAULT};
126+
#endif // defined(OS_WIN) || defined(OS_CHROMEOS)
127+
123128
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
124129
// Enables stylus appearing as touch when in contact with digitizer.
125130
const base::Feature kDirectManipulationStylus = {
@@ -149,6 +154,15 @@ bool IsSingleProcessMash() {
149154
return base::FeatureList::IsEnabled(features::kSingleProcessMash);
150155
}
151156

157+
bool IsAutomaticUiAdjustmentsForTouchEnabled() {
158+
#if defined(OS_WIN) || defined(OS_CHROMEOS)
159+
return base::FeatureList::IsEnabled(
160+
features::kEnableAutomaticUiAdjustmentsForTouch);
161+
#else
162+
return false;
163+
#endif
164+
}
165+
152166
#if defined(OS_MACOSX)
153167
// When enabled, the NSWindows for apps will be created in the app's process,
154168
// and will forward input to the browser process.

ui/base/ui_base_features.h

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ UI_BASE_EXPORT extern const base::Feature kTSFImeSupport;
4343
UI_BASE_EXPORT bool IsUsingWMPointerForTouch();
4444
#endif // defined(OS_WIN)
4545

46+
#if defined(OS_WIN) || defined(OS_CHROMEOS)
47+
UI_BASE_EXPORT extern const base::Feature kEnableAutomaticUiAdjustmentsForTouch;
48+
#endif // defined(OS_WIN) || defined(OS_CHROMEOS)
49+
4650
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
4751
UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus;
4852
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
@@ -68,6 +72,9 @@ UI_BASE_EXPORT bool IsMultiProcessMash();
6872
// See //ash/README.md.
6973
UI_BASE_EXPORT bool IsSingleProcessMash();
7074

75+
// Whether the UI may accommodate touch input in response to hardware changes.
76+
UI_BASE_EXPORT bool IsAutomaticUiAdjustmentsForTouchEnabled();
77+
7178
#if defined(OS_MACOSX)
7279
UI_BASE_EXPORT extern const base::Feature kHostWindowsInAppShimProcess;
7380

0 commit comments

Comments
 (0)