Commit 233c560e authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Re-enable HideShelfControlsInTabletMode by default

BUG=1085130

Change-Id: Iff53ea98b0665fb082e39d27675dbdf6ad2c4c0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210737Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770747}
parent dabe2d08
...@@ -4,32 +4,15 @@ ...@@ -4,32 +4,15 @@
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
#include <vector>
#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/ash_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/strings/string_split.h"
#include "base/system/sys_info.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
namespace ash { namespace ash {
namespace features { namespace features {
namespace {
bool IsBoardKukui() {
std::vector<std::string> board =
base::SplitString(base::SysInfo::GetLsbReleaseBoard(), "-",
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
if (board.empty())
return false;
return board[0] == "kukui";
}
} // namespace
const base::Feature kAllowAmbientEQ{"AllowAmbientEQ", const base::Feature kAllowAmbientEQ{"AllowAmbientEQ",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
...@@ -136,7 +119,7 @@ const base::Feature kDragFromShelfToHomeOrOverview{ ...@@ -136,7 +119,7 @@ const base::Feature kDragFromShelfToHomeOrOverview{
"DragFromShelfToHomeOrOverview", base::FEATURE_DISABLED_BY_DEFAULT}; "DragFromShelfToHomeOrOverview", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kHideShelfControlsInTabletMode{ const base::Feature kHideShelfControlsInTabletMode{
"HideShelfControlsInTabletMode", base::FEATURE_DISABLED_BY_DEFAULT}; "HideShelfControlsInTabletMode", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSystemTrayMicGainSetting{ const base::Feature kSystemTrayMicGainSetting{
"SystemTrayMicGainSetting", base::FEATURE_DISABLED_BY_DEFAULT}; "SystemTrayMicGainSetting", base::FEATURE_DISABLED_BY_DEFAULT};
...@@ -251,17 +234,8 @@ bool IsReduceDisplayNotificationsEnabled() { ...@@ -251,17 +234,8 @@ bool IsReduceDisplayNotificationsEnabled() {
} }
bool IsHideShelfControlsInTabletModeEnabled() { bool IsHideShelfControlsInTabletModeEnabled() {
if (!IsDragFromShelfToHomeOrOverviewEnabled()) return base::FeatureList::IsEnabled(kHideShelfControlsInTabletMode) &&
return false; IsDragFromShelfToHomeOrOverviewEnabled();
// Enable shelf navigation buttons by default on kukui.
// TODO(https://crbug.com/1084226): A better approach would be to have login
// manager enable the feature by setting an appropriate enable_features flag.
static const bool is_kukui = IsBoardKukui();
if (is_kukui)
return true;
return base::FeatureList::IsEnabled(kHideShelfControlsInTabletMode);
} }
bool IsDisplayChangeModalEnabled() { bool IsDisplayChangeModalEnabled() {
...@@ -269,6 +243,8 @@ bool IsDisplayChangeModalEnabled() { ...@@ -269,6 +243,8 @@ bool IsDisplayChangeModalEnabled() {
} }
bool AreContextualNudgesEnabled() { bool AreContextualNudgesEnabled() {
if (!IsHideShelfControlsInTabletModeEnabled())
return false;
return base::FeatureList::IsEnabled(kContextualNudges); return base::FeatureList::IsEnabled(kContextualNudges);
} }
......
...@@ -111,6 +111,9 @@ bool DragHandle::MaybeShowDragHandleNudge() { ...@@ -111,6 +111,9 @@ bool DragHandle::MaybeShowDragHandleNudge() {
if (!show_drag_handle_nudge_timer_.IsRunning()) if (!show_drag_handle_nudge_timer_.IsRunning())
overview_observer_.RemoveAll(); overview_observer_.RemoveAll();
if (!features::AreContextualNudgesEnabled())
return false;
// Do not show drag handle nudge if it is already shown or drag handle is not // Do not show drag handle nudge if it is already shown or drag handle is not
// visible. // visible.
if (gesture_nudge_target_visibility() || if (gesture_nudge_target_visibility() ||
......
...@@ -38,10 +38,7 @@ ShelfLayoutManager* GetShelfLayoutManager() { ...@@ -38,10 +38,7 @@ ShelfLayoutManager* GetShelfLayoutManager() {
class DragHandleContextualNudgeTest : public ShelfLayoutManagerTestBase { class DragHandleContextualNudgeTest : public ShelfLayoutManagerTestBase {
public: public:
DragHandleContextualNudgeTest() { DragHandleContextualNudgeTest() {
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitAndEnableFeature(ash::features::kContextualNudges);
{ash::features::kContextualNudges,
ash::features::kHideShelfControlsInTabletMode},
{});
} }
~DragHandleContextualNudgeTest() override = default; ~DragHandleContextualNudgeTest() override = default;
......
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