Commit dc273a4f authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Relax #upcoming-ui-features Setting of #top-chrome-md Flags

Setting #upcoming-ui-features previously locked you into Material
Refresh. If you have a touchable device, you probably want
Material Refresh Touchable.

This change also allows users to choose between Material Refresh
and Material Refresh Touchable if #upcoming-ui-features is set.

BUG=870002

Change-Id: I8006fcaab8c6f8da299b77fafb9e3418f18bbfa5
Reviewed-on: https://chromium-review.googlesource.com/1159239Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580982}
parent f12e2d5c
......@@ -121,18 +121,23 @@ void MaterialDesignController::Initialize() {
base::FeatureList::IsEnabled(features::kExperimentalUi);
#endif
if (force_material_refresh ||
switch_value == switches::kTopChromeMDMaterialRefresh) {
if (switch_value == switches::kTopChromeMDMaterialRefresh) {
SetMode(MATERIAL_REFRESH);
} else if (switch_value ==
switches::kTopChromeMDMaterialRefreshTouchOptimized) {
SetMode(MATERIAL_TOUCH_REFRESH);
} else if (force_material_refresh) {
bool has_touchscreen = false;
#if defined(OS_CHROMEOS)
has_touchscreen = HasTouchscreen();
#endif
SetMode(has_touchscreen ? MATERIAL_TOUCH_REFRESH : MATERIAL_REFRESH);
} else if (switch_value == switches::kTopChromeMDMaterial) {
SetMode(MATERIAL_NORMAL);
} else if (switch_value == switches::kTopChromeMDMaterialHybrid) {
SetMode(MATERIAL_HYBRID);
} else if (switch_value == switches::kTopChromeMDMaterialTouchOptimized) {
SetMode(MATERIAL_TOUCH_OPTIMIZED);
} else if (switch_value ==
switches::kTopChromeMDMaterialRefreshTouchOptimized) {
SetMode(MATERIAL_TOUCH_REFRESH);
} else if (switch_value == switches::kTopChromeMDMaterialAuto) {
#if defined(OS_WIN)
// TODO(girard): add support for switching between modes when
......
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