Commit 9ae550aa authored by Xiaodan Zhu's avatar Xiaodan Zhu Committed by Commit Bot

Add feature flag for fullscreen alert bubble.

This CL add a feature flag kFullscreenAlertBubble to the feature
of Fullscreen Alert Bubble.

Bug: 1107185
Change-Id: I76c3ef33df6056f7a33f0a23294ce2ef169a2326
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520323Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Xiaodan Zhu <zxdan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824911}
parent e3f8675f
...@@ -120,6 +120,9 @@ const base::Feature kHideShelfControlsInTabletMode{ ...@@ -120,6 +120,9 @@ const base::Feature kHideShelfControlsInTabletMode{
const base::Feature kReverseScrollGestures{"EnableReverseScrollGestures", const base::Feature kReverseScrollGestures{"EnableReverseScrollGestures",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kFullscreenAlertBubble{"EnableFullscreenBubble",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSystemTrayMicGainSetting{"SystemTrayMicGainSetting", const base::Feature kSystemTrayMicGainSetting{"SystemTrayMicGainSetting",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
...@@ -255,6 +258,10 @@ bool IsReverseScrollGesturesEnabled() { ...@@ -255,6 +258,10 @@ bool IsReverseScrollGesturesEnabled() {
return base::FeatureList::IsEnabled(kReverseScrollGestures); return base::FeatureList::IsEnabled(kReverseScrollGestures);
} }
bool IsFullscreenAlertBubbleEnabled() {
return base::FeatureList::IsEnabled(kFullscreenAlertBubble);
}
bool AreContextualNudgesEnabled() { bool AreContextualNudgesEnabled() {
if (!IsHideShelfControlsInTabletModeEnabled()) if (!IsHideShelfControlsInTabletModeEnabled())
return false; return false;
......
...@@ -159,6 +159,12 @@ ASH_PUBLIC_EXPORT extern const base::Feature kHideShelfControlsInTabletMode; ...@@ -159,6 +159,12 @@ ASH_PUBLIC_EXPORT extern const base::Feature kHideShelfControlsInTabletMode;
// TODO(https://crbug.com/1107183): Remove this after the feature is launched. // TODO(https://crbug.com/1107183): Remove this after the feature is launched.
ASH_PUBLIC_EXPORT extern const base::Feature kReverseScrollGestures; ASH_PUBLIC_EXPORT extern const base::Feature kReverseScrollGestures;
// When enabled, there will be an alert bubble showing up when the device
// returns from low brightness (e.g., sleep, closed cover) without a lock screen
// and the active window is in fullscreen.
// TODO(https://crbug.com/1107185): Remove this after the feature is launched.
ASH_PUBLIC_EXPORT extern const base::Feature kFullscreenAlertBubble;
// Enables sliders for setting mic gain levels in the more audio settings // Enables sliders for setting mic gain levels in the more audio settings
// section in the system tray. // section in the system tray.
ASH_PUBLIC_EXPORT extern const base::Feature kSystemTrayMicGainSetting; ASH_PUBLIC_EXPORT extern const base::Feature kSystemTrayMicGainSetting;
...@@ -234,6 +240,8 @@ ASH_PUBLIC_EXPORT bool IsHideShelfControlsInTabletModeEnabled(); ...@@ -234,6 +240,8 @@ ASH_PUBLIC_EXPORT bool IsHideShelfControlsInTabletModeEnabled();
ASH_PUBLIC_EXPORT bool IsReverseScrollGesturesEnabled(); ASH_PUBLIC_EXPORT bool IsReverseScrollGesturesEnabled();
ASH_PUBLIC_EXPORT bool IsFullscreenAlertBubbleEnabled();
ASH_PUBLIC_EXPORT bool AreContextualNudgesEnabled(); ASH_PUBLIC_EXPORT bool AreContextualNudgesEnabled();
ASH_PUBLIC_EXPORT bool IsSystemTrayMicGainSettingEnabled(); ASH_PUBLIC_EXPORT bool IsSystemTrayMicGainSettingEnabled();
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <limits> #include <limits>
#include "ash/login/ui/lock_screen.h" #include "ash/login/ui/lock_screen.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/session/fullscreen_alert_bubble.h" #include "ash/session/fullscreen_alert_bubble.h"
#include "ash/session/session_controller_impl.h" #include "ash/session/session_controller_impl.h"
#include "ash/shelf/shelf.h" #include "ash/shelf/shelf.h"
...@@ -56,6 +57,9 @@ void FullscreenController::MaybeExitFullscreen() { ...@@ -56,6 +57,9 @@ void FullscreenController::MaybeExitFullscreen() {
} }
void FullscreenController::MaybeShowAlert() { void FullscreenController::MaybeShowAlert() {
if (!features::IsFullscreenAlertBubbleEnabled())
return;
// 1. Check if there is a lock/login screen showing up. // 1. Check if there is a lock/login screen showing up.
if (LockScreen::HasInstance()) if (LockScreen::HasInstance())
return; return;
......
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