Commit 02198527 authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Commit Bot

CrOS: Create separate flag for notifications in context menus

Work is being done on shelf notification indicators as a separate
feature from context menu notifications, so create a new flag to
separate the two features.

Bug: 1080827
Change-Id: I9e6a2a20a30b692a5e9c185b904b0ff337eaad39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2228189
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774726}
parent b8c1b3b2
......@@ -5,12 +5,12 @@
#include "ash/app_menu/app_menu_model_adapter.h"
#include "ash/app_menu/notification_menu_controller.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/shelf_model.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
#include "ui/views/controls/menu/menu_runner.h"
......@@ -65,7 +65,7 @@ void AppMenuModelAdapter::Run(const gfx::Rect& menu_anchor_rect,
menu_open_time_ = base::TimeTicks::Now();
root_ = CreateMenu();
if (features::IsNotificationIndicatorEnabled()) {
if (ash::features::IsNotificationsInContextMenuEnabled()) {
notification_menu_controller_ =
std::make_unique<NotificationMenuController>(app_id_, root_, this);
}
......
......@@ -130,6 +130,9 @@ const base::Feature kWebUITabStripTabDragIntegration{
const base::Feature kShelfAppScaling{"ShelfAppScaling",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kNotificationsInContextMenu{
"NotificationsInContextMenu", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsAllowAmbientEQEnabled() {
return base::FeatureList::IsEnabled(kAllowAmbientEQ);
}
......@@ -277,6 +280,10 @@ bool IsAppScalingEnabled() {
chromeos::switches::ShouldShowShelfHotseat();
}
bool IsNotificationsInContextMenuEnabled() {
return base::FeatureList::IsEnabled(kNotificationsInContextMenu);
}
namespace {
// The boolean flag indicating if "WebUITabStrip" feature is enabled in Chrome.
......
......@@ -166,6 +166,9 @@ ASH_PUBLIC_EXPORT extern const base::Feature kSystemTrayMicGainSetting;
// right now since it is under development.
ASH_PUBLIC_EXPORT extern const base::Feature kWebUITabStripTabDragIntegration;
// Enables notifications to be shown within context menus.
ASH_PUBLIC_EXPORT extern const base::Feature kNotificationsInContextMenu;
ASH_PUBLIC_EXPORT bool IsAllowAmbientEQEnabled();
ASH_PUBLIC_EXPORT bool IsAltTabLimitedToActiveDesk();
......@@ -230,6 +233,8 @@ ASH_PUBLIC_EXPORT bool IsMovablePartialScreenshotEnabled();
ASH_PUBLIC_EXPORT bool IsAppScalingEnabled();
ASH_PUBLIC_EXPORT bool IsNotificationsInContextMenuEnabled();
// These two functions are supposed to be temporary functions to set or get
// whether "WebUITabStrip" feature is enabled from Chrome.
ASH_PUBLIC_EXPORT void SetWebUITabStripEnabled(bool enabled);
......
......@@ -1275,9 +1275,8 @@ const char kTextureLayerSkipWaitForActivationDescription[] =
const char kNotificationIndicatorName[] = "Notification Indicators";
const char kNotificationIndicatorDescription[] =
"Enable notification indicators, which appear on app icons when a "
"notification is active. This will also enable notifications in context "
"menus.";
"Enable notification indicators, which appear on shelf app icons when a "
"notification is active.";
const char kNotificationSchedulerDebugOptionName[] =
"Notification scheduler debug options";
......
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