Skip to content

Commit

Permalink
Add a flag to hide scroll bar in notification list
Browse files Browse the repository at this point in the history
ARC++ notifications are shown above scroll bar, so we temporarily make
scroll bar invisible as a workaround.

When the limitation is removed from ARC++, the flag will be removed and
the scroll bar will be restored.

TEST=manual
BUG=858940

Change-Id: I6931c6406c9feb2bb4159d737205187bdc88b86b
Reviewed-on: https://chromium-review.googlesource.com/1140014
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576755}
  • Loading branch information
Tetsui Ohkubo authored and Commit Bot committed Jul 20, 2018
1 parent 62da7b8 commit c3eb87f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ash/message_center/message_center_scroll_bar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "ash/message_center/message_center_scroll_bar.h"

#include "ash/public/cpp/ash_features.h"
#include "base/metrics/histogram_macros.h"

namespace {
Expand All @@ -26,7 +27,10 @@ void CollectScrollActionReason(ScrollActionReason reason) {
namespace ash {

MessageCenterScrollBar::MessageCenterScrollBar()
: views::OverlayScrollBar(false) {}
: views::OverlayScrollBar(false) {
GetThumb()->layer()->SetVisible(!features::IsSystemTrayUnifiedEnabled() ||
features::IsNotificationScrollBarEnabled());
}

bool MessageCenterScrollBar::OnKeyPressed(const ui::KeyEvent& event) {
if (!stats_recorded_ &&
Expand Down
7 changes: 7 additions & 0 deletions ash/public/cpp/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const base::Feature kNewWallpaperPicker{"NewWallpaperPicker",

const base::Feature kNightLight{"NightLight", base::FEATURE_ENABLED_BY_DEFAULT};

const base::Feature kNotificationScrollBar{"NotificationScrollBar",
base::FEATURE_DISABLED_BY_DEFAULT};

const base::Feature kOverviewSwipeToClose{"OverviewSwipeToClose",
base::FEATURE_DISABLED_BY_DEFAULT};

Expand Down Expand Up @@ -76,6 +79,10 @@ bool IsNightLightEnabled() {
return base::FeatureList::IsEnabled(kNightLight);
}

bool IsNotificationScrollBarEnabled() {
return base::FeatureList::IsEnabled(kNotificationScrollBar);
}

bool IsSystemTrayUnifiedEnabled() {
return base::FeatureList::IsEnabled(kSystemTrayUnified);
}
Expand Down
5 changes: 5 additions & 0 deletions ash/public/cpp/ash_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ ASH_PUBLIC_EXPORT extern const base::Feature kNewWallpaperPicker;
// Enables the Night Light feature.
ASH_PUBLIC_EXPORT extern const base::Feature kNightLight;

// Enables notification scroll bar in UnifiedSystemTray.
ASH_PUBLIC_EXPORT extern const base::Feature kNotificationScrollBar;

// Enables swipe to close in overview mode.
// TODO(sammiequon): Remove this after the feature is fully launched.
// https://crbug.com/828646.
Expand Down Expand Up @@ -81,6 +84,8 @@ ASH_PUBLIC_EXPORT bool IsNewWallpaperPickerEnabled();

ASH_PUBLIC_EXPORT bool IsNightLightEnabled();

ASH_PUBLIC_EXPORT bool IsNotificationScrollBarEnabled();

ASH_PUBLIC_EXPORT bool IsSystemTrayUnifiedEnabled();

ASH_PUBLIC_EXPORT bool IsTrilinearFilteringEnabled();
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,10 @@ const FeatureEntry kFeatureEntries[] = {
{"ash-enable-night-light", flag_descriptions::kEnableNightLightName,
flag_descriptions::kEnableNightLightDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kNightLight)},
{"ash-enable-notification-scroll-bar",
flag_descriptions::kEnableNotificationScrollBarName,
flag_descriptions::kEnableNotificationScrollBarDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kNotificationScrollBar)},
{"allow-touchpad-three-finger-click",
flag_descriptions::kAllowTouchpadThreeFingerClickName,
flag_descriptions::kAllowTouchpadThreeFingerClickDescription, kOsCrOS,
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ const char kEnableNightLightDescription[] =
"Enable the Night Light feature which controls the color temperature of "
"the screen.";

const char kEnableNotificationScrollBarName[] =
"Enable notification list scroll bar";
const char kEnableNotificationScrollBarDescription[] =
"Enable the scroll bar of the notification list in Unified System Tray.";

const char kEnableNupPrintingName[] = "Enable N-up printing";
const char kEnableNupPrintingDescription[] =
"Enable N-up printing in the print preview panel.";
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ extern const char kEnableNewPrintPreviewDescription[];
extern const char kEnableNightLightName[];
extern const char kEnableNightLightDescription[];

extern const char kEnableNotificationScrollBarName[];
extern const char kEnableNotificationScrollBarDescription[];

extern const char kEnableNupPrintingName[];
extern const char kEnableNupPrintingDescription[];

Expand Down
2 changes: 2 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27430,6 +27430,7 @@ from previous Chrome versions.
<int value="-2099035488" label="enable-data-reduction-proxy-bypass-warning"/>
<int value="-2098610409" label="disable-lcd-text"/>
<int value="-2098243118" label="OmniboxTailSuggestions:disabled"/>
<int value="-2097895488" label="NotificationScrollBar:enabled"/>
<int value="-2097515669" label="disable-cast"/>
<int value="-2091404586" label="TabStripKeyboardFocus:enabled"/>
<int value="-2090484194" label="ContextualSearchUrlActions:disabled"/>
Expand Down Expand Up @@ -28192,6 +28193,7 @@ from previous Chrome versions.
<int value="-621382525" label="VizDisplayCompositor:enabled"/>
<int value="-620030047" label="CrosCompUpdates:disabled"/>
<int value="-617452890" label="media-router"/>
<int value="-612633819" label="NotificationScrollBar:disabled"/>
<int value="-612480090" label="FasterLocationReload:enabled"/>
<int value="-610411643" label="enable-printer-app-search"/>
<int value="-606898702" label="MaterialDesignSettings:disabled"/>
Expand Down

0 comments on commit c3eb87f

Please sign in to comment.