File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ void MaterialDesignController::Initialize() {
65
65
66
66
// When the mode is not explicitly forced, platforms vary as to the default
67
67
// behavior.
68
- if (!touch && (switch_value != switches::kTopChromeTouchUiDisabled )) {
68
+ if (!touch && (switch_value != switches::kTopChromeTouchUiDisabled ) &&
69
+ features::IsAutomaticUiAdjustmentsForTouchEnabled ()) {
69
70
#if defined(OS_CHROMEOS)
70
71
// TabletModeClient's default state is in non-tablet mode.
71
72
automatic_touch_ui_ = true ;
Original file line number Diff line number Diff line change @@ -120,6 +120,11 @@ const base::Feature kPrecisionTouchpadScrollPhase{
120
120
" PrecisionTouchpadScrollPhase" , base::FEATURE_ENABLED_BY_DEFAULT};
121
121
#endif // defined(OS_WIN)
122
122
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
+
123
128
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
124
129
// Enables stylus appearing as touch when in contact with digitizer.
125
130
const base::Feature kDirectManipulationStylus = {
@@ -149,6 +154,15 @@ bool IsSingleProcessMash() {
149
154
return base::FeatureList::IsEnabled (features::kSingleProcessMash );
150
155
}
151
156
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
+
152
166
#if defined(OS_MACOSX)
153
167
// When enabled, the NSWindows for apps will be created in the app's process,
154
168
// and will forward input to the browser process.
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ UI_BASE_EXPORT extern const base::Feature kTSFImeSupport;
43
43
UI_BASE_EXPORT bool IsUsingWMPointerForTouch ();
44
44
#endif // defined(OS_WIN)
45
45
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
+
46
50
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
47
51
UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus ;
48
52
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
@@ -68,6 +72,9 @@ UI_BASE_EXPORT bool IsMultiProcessMash();
68
72
// See //ash/README.md.
69
73
UI_BASE_EXPORT bool IsSingleProcessMash ();
70
74
75
+ // Whether the UI may accommodate touch input in response to hardware changes.
76
+ UI_BASE_EXPORT bool IsAutomaticUiAdjustmentsForTouchEnabled ();
77
+
71
78
#if defined(OS_MACOSX)
72
79
UI_BASE_EXPORT extern const base::Feature kHostWindowsInAppShimProcess ;
73
80
You can’t perform that action at this time.
0 commit comments