forest: Use util function instead of feature check.
Original CL:5449370 is on PS1. The change from the original patch is that several things that will be created before active user has logged in will be created if the feature flag is enabled. This includes: - PineController - BirchModel - Registering Forest prefs - Wallpaper Underlay Layer That does mean that these are created and possibly not used. But the code change is smaller and will be easier to revert once the secret key is removed. Test: manual Bug: b:333952534 Change-Id: I78cf38546eb73a2e2ca7b90f3ded7d474982b662 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5454910 Reviewed-by: Toni Barzic <tbarzic@chromium.org> Commit-Queue: Sammie Quon <sammiequon@chromium.org> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Cr-Commit-Position: refs/heads/main@{#1287838}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
9a733188ea
commit
e1d043af3c
ash
chrome/browser
ash
app_restore
file_suggest
login
session
release_notes
system_web_apps
apps
ui
ash
@ -252,10 +252,8 @@ void HandleToggleVirtualTrackpad() {
|
||||
}
|
||||
|
||||
void HandleShowInformedRestore() {
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
Shell::Get()
|
||||
->pine_controller()
|
||||
->MaybeStartPineOverviewSessionDevAccelerator();
|
||||
if (auto* pine_controller = Shell::Get()->pine_controller()) {
|
||||
pine_controller->MaybeStartPineOverviewSessionDevAccelerator();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3577,11 +3577,6 @@ bool IsForceReSyncDriveEnabled() {
|
||||
return base::FeatureList::IsEnabled(kForceReSyncDrive);
|
||||
}
|
||||
|
||||
bool IsForestFeatureEnabled() {
|
||||
return base::FeatureList::IsEnabled(kForestFeature) &&
|
||||
switches::IsForestSecretKeyMatched();
|
||||
}
|
||||
|
||||
bool IsFullscreenAfterUnlockAllowed() {
|
||||
return base::FeatureList::IsEnabled(kFullscreenAfterUnlockAllowed);
|
||||
}
|
||||
|
@ -1046,7 +1046,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsFocusModeEnabled();
|
||||
COMPONENT_EXPORT(ASH_CONSTANTS)
|
||||
bool ShouldForceEnableServerSideSpeechRecognitionForDev();
|
||||
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsForceReSyncDriveEnabled();
|
||||
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsForestFeatureEnabled();
|
||||
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsEcheLauncherEnabled();
|
||||
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsEcheLauncherListViewEnabled();
|
||||
COMPONENT_EXPORT(ASH_CONSTANTS)
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "ash/touch/touch_hud_debug.h"
|
||||
#include "ash/touch/touch_hud_projection.h"
|
||||
#include "ash/touch/touch_observer_hud.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wallpaper/views/wallpaper_widget_controller.h"
|
||||
#include "ash/wm/always_on_top_controller.h"
|
||||
#include "ash/wm/bounds_tracker/window_bounds_tracker.h"
|
||||
@ -846,7 +847,7 @@ void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen,
|
||||
ui::MenuSourceType source_type) {
|
||||
// Show birch bar context menu for the primary user in clamshell mode Overview
|
||||
// without a partial split screen.
|
||||
if (features::IsForestFeatureEnabled() &&
|
||||
if (IsForestFeatureEnabled() &&
|
||||
Shell::Get()->session_controller()->IsUserPrimary() &&
|
||||
OverviewController::Get()->InOverviewSession() &&
|
||||
!split_view_overview_session_) {
|
||||
@ -1214,7 +1215,7 @@ void RootWindowController::CreateContainers() {
|
||||
non_lock_screen_containers);
|
||||
|
||||
aura::Window* shutdown_screenshot_container = non_lock_screen_containers;
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureFlagEnabled()) {
|
||||
shutdown_screenshot_container = CreateContainer(
|
||||
kShellWindowId_ShutdownScreenshotContainer,
|
||||
"ShutdownScreenshotContainer", non_lock_screen_containers);
|
||||
|
@ -499,6 +499,12 @@ class HotseatWidget::DelegateView : public HotseatTransitionAnimator::Observer,
|
||||
|
||||
// The type of highlight border.
|
||||
views::HighlightBorder::Type border_type_;
|
||||
|
||||
// Tracks whether the forest flag was enabled when entering overview.
|
||||
// TODO(sammiequon): This is temporary while the secret key exists. After the
|
||||
// secret key is removed, entering/exiting overview should never need to
|
||||
// remove/readd blur.
|
||||
bool was_forest_on_overview_enter_ = false;
|
||||
};
|
||||
|
||||
HotseatWidget::DelegateView::~DelegateView() {
|
||||
@ -716,7 +722,8 @@ bool HotseatWidget::DelegateView::CanActivate() const {
|
||||
|
||||
void HotseatWidget::DelegateView::OnOverviewModeWillStart() {
|
||||
// Forest uses background blur in overview.
|
||||
if (IsForestFeatureEnabled()) {
|
||||
was_forest_on_overview_enter_ = IsForestFeatureEnabled();
|
||||
if (was_forest_on_overview_enter_) {
|
||||
return;
|
||||
}
|
||||
DCHECK_LE(blur_lock_, 2);
|
||||
@ -728,7 +735,8 @@ void HotseatWidget::DelegateView::OnOverviewModeWillStart() {
|
||||
void HotseatWidget::DelegateView::OnOverviewModeEndingAnimationComplete(
|
||||
bool canceled) {
|
||||
// Forest uses background blur in overview.
|
||||
if (IsForestFeatureEnabled()) {
|
||||
if (was_forest_on_overview_enter_) {
|
||||
was_forest_on_overview_enter_ = false;
|
||||
return;
|
||||
}
|
||||
DCHECK_GT(blur_lock_, 0);
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "ash/style/ash_color_id.h"
|
||||
#include "ash/style/style_util.h"
|
||||
#include "ash/system/status_area_widget.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
|
||||
#include "ash/wm/work_area_insets.h"
|
||||
#include "base/command_line.h"
|
||||
@ -489,8 +490,7 @@ void ShelfWidget::DelegateView::UpdateOpaqueBackground() {
|
||||
const bool in_app = ShelfConfig::Get()->is_in_app();
|
||||
|
||||
const bool in_overview_mode = ShelfConfig::Get()->in_overview_mode();
|
||||
const bool in_oak_session =
|
||||
features::IsForestFeatureEnabled() && in_overview_mode;
|
||||
const bool in_oak_session = IsForestFeatureEnabled() && in_overview_mode;
|
||||
const bool split_view = ShelfConfig::Get()->in_split_view_with_overview();
|
||||
bool show_opaque_background =
|
||||
(!in_oak_session) && (!tablet_mode || in_app || split_view);
|
||||
|
@ -197,6 +197,7 @@
|
||||
#include "ash/tray_action/tray_action.h"
|
||||
#include "ash/user_education/user_education_controller.h"
|
||||
#include "ash/user_education/user_education_delegate.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/utility/occlusion_tracker_pauser.h"
|
||||
#include "ash/wallpaper/wallpaper_controller_impl.h"
|
||||
#include "ash/wm/ash_focus_rules.h"
|
||||
@ -1592,7 +1593,7 @@ void Shell::Init(
|
||||
// used in its constructor.
|
||||
app_list_controller_ = std::make_unique<AppListControllerImpl>();
|
||||
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureFlagEnabled()) {
|
||||
birch_model_ = std::make_unique<BirchModel>();
|
||||
}
|
||||
|
||||
@ -1769,7 +1770,7 @@ void Shell::Init(
|
||||
projector_controller_ = std::make_unique<ProjectorControllerImpl>();
|
||||
|
||||
float_controller_ = std::make_unique<FloatController>();
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureFlagEnabled()) {
|
||||
pine_controller_ = std::make_unique<PineController>();
|
||||
}
|
||||
pip_controller_ = std::make_unique<PipController>();
|
||||
|
@ -12,16 +12,23 @@
|
||||
|
||||
namespace ash {
|
||||
|
||||
bool IsForestFeatureFlagEnabled() {
|
||||
return base::FeatureList::IsEnabled(features::kForestFeature);
|
||||
}
|
||||
|
||||
bool IsForestFeatureEnabled() {
|
||||
if (!base::FeatureList::IsEnabled(features::kForestFeature)) {
|
||||
if (!IsForestFeatureFlagEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO(http://b/333952534): Remove the google api DEPS changes.
|
||||
if (gaia::IsGoogleInternalAccountEmail(Shell::Get()
|
||||
->session_controller()
|
||||
->GetActiveAccountId()
|
||||
.GetUserEmail())) {
|
||||
// The shell may not be created in some unit tests.
|
||||
Shell* shell = Shell::HasInstance() ? Shell::Get() : nullptr;
|
||||
|
||||
// TODO(http://b/333952534): Remove the google api DEPS changes, and move this
|
||||
// function back to ash/constants/ash_features.
|
||||
if (shell &&
|
||||
gaia::IsGoogleInternalAccountEmail(
|
||||
shell->session_controller()->GetActiveAccountId().GetUserEmail())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
namespace ash {
|
||||
|
||||
ASH_EXPORT bool IsForestFeatureFlagEnabled();
|
||||
|
||||
// Checks for the forest feature. This needs a secret key, unless the active
|
||||
// user is a google account.
|
||||
ASH_EXPORT bool IsForestFeatureEnabled();
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
#include "ash/wallpaper/views/wallpaper_widget_controller.h"
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/public/cpp/shell_window_ids.h"
|
||||
#include "ash/root_window_controller.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/style/color_util.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wallpaper/views/wallpaper_view.h"
|
||||
#include "ui/aura/window.h"
|
||||
#include "ui/chromeos/styles/cros_tokens_color_mappings.h"
|
||||
@ -140,7 +140,7 @@ void WallpaperWidgetController::OnColorProviderChanged() {
|
||||
}
|
||||
|
||||
void WallpaperWidgetController::CreateWallpaperUnderlayLayer() {
|
||||
if (!features::IsForestFeatureEnabled()) {
|
||||
if (!IsForestFeatureFlagEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "ash/strings/grit/ash_strings.h"
|
||||
#include "ash/style/ash_color_id.h"
|
||||
#include "ash/style/typography.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wm/desks/desk.h"
|
||||
#include "ash/wm/desks/desk_action_button.h"
|
||||
#include "ash/wm/desks/desk_action_view.h"
|
||||
@ -125,7 +126,7 @@ void MaybeSetupBackgroundView(DeskBarViewBase* bar_view) {
|
||||
auto* layer = view->layer();
|
||||
layer->SetFillsBoundsOpaquely(false);
|
||||
|
||||
if (features::IsForestFeatureEnabled() && !type_is_desk_button) {
|
||||
if (IsForestFeatureEnabled() && !type_is_desk_button) {
|
||||
// Forests feature needs a transparent desks bar background. Still needs the
|
||||
// view layer to perform animations.
|
||||
return;
|
||||
@ -623,9 +624,8 @@ int DeskBarViewBase::GetPreferredBarHeight(aura::Window* root,
|
||||
height = kDeskBarZeroStateHeight;
|
||||
} else {
|
||||
height = DeskPreviewView::GetHeight(root) +
|
||||
(features::IsForestFeatureEnabled()
|
||||
? kExpandedDeskBarHeightWithOak
|
||||
: kDeskBarNonPreviewAllocatedHeight);
|
||||
(IsForestFeatureEnabled() ? kExpandedDeskBarHeightWithOak
|
||||
: kDeskBarNonPreviewAllocatedHeight);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "ash/app_list/app_list_controller_impl.h"
|
||||
#include "ash/cancel_mode.h"
|
||||
#include "ash/capture_mode/capture_mode_controller.h"
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/constants/ash_pref_names.h"
|
||||
#include "ash/public/cpp/saved_desk_delegate.h"
|
||||
#include "ash/public/cpp/shell_window_ids.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include "ash/session/session_controller_impl.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/shell_delegate.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/utility/occlusion_tracker_pauser.h"
|
||||
#include "ash/wallpaper/views/wallpaper_view.h"
|
||||
#include "ash/wallpaper/views/wallpaper_widget_controller.h"
|
||||
@ -459,7 +459,7 @@ void LockStateController::CancelShutdownAnimation() {
|
||||
void LockStateController::RequestRestart(
|
||||
power_manager::RequestRestartReason reason,
|
||||
const std::string& description) {
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
restart_reason_ = reason;
|
||||
restart_description_ = description;
|
||||
HideAndMaybeLockCursor(/*lock=*/false);
|
||||
@ -813,7 +813,7 @@ void LockStateController::OnRealPowerTimeout() {
|
||||
}
|
||||
|
||||
void LockStateController::ShutdownOnPine(bool with_pre_animation) {
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
TakePineImageAndShutdown(with_pre_animation);
|
||||
} else {
|
||||
StartShutdownProcess(with_pre_animation);
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "ash/style/rounded_label_widget.h"
|
||||
#include "ash/style/typography.h"
|
||||
#include "ash/system/toast/toast_manager_impl.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wallpaper/wallpaper_controller_impl.h"
|
||||
#include "ash/wm/desks/default_desk_button.h"
|
||||
#include "ash/wm/desks/desk_bar_view_base.h"
|
||||
@ -537,7 +538,7 @@ bool ShouldShowBirchBar(aura::Window* root_window) {
|
||||
// disabled by users. We don't need to worry about showing/hiding the bar
|
||||
// dynamically on primary/secondary user switch because we exit overview when
|
||||
// we switch users.
|
||||
return features::IsForestFeatureEnabled() &&
|
||||
return IsForestFeatureEnabled() &&
|
||||
Shell::Get()->session_controller()->IsUserPrimary() &&
|
||||
BirchBarController::Get()->GetShowBirchSuggestions() &&
|
||||
!SplitViewController::Get(root_window)->InSplitViewMode();
|
||||
@ -545,7 +546,7 @@ bool ShouldShowBirchBar(aura::Window* root_window) {
|
||||
|
||||
bool ShouldShowPineDialog(aura::Window* root_window) {
|
||||
return root_window == Shell::GetPrimaryRootWindow() &&
|
||||
features::IsForestFeatureEnabled() &&
|
||||
IsForestFeatureEnabled() &&
|
||||
!!Shell::Get()->pine_controller()->pine_contents_data();
|
||||
}
|
||||
|
||||
@ -682,7 +683,7 @@ void OverviewGrid::PrepareForOverview() {
|
||||
|
||||
MaybeInitBirchBarWidget();
|
||||
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
scoped_overview_wallpaper_clipper_ =
|
||||
std::make_unique<ScopedOverviewWallpaperClipper>(this);
|
||||
}
|
||||
@ -792,7 +793,7 @@ void OverviewGrid::PositionWindows(
|
||||
|
||||
// Create a feedback button that shows even when no items are present (e.g.,
|
||||
// for Pine).
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
UpdateFeedbackButton();
|
||||
}
|
||||
|
||||
@ -1659,7 +1660,7 @@ gfx::Rect OverviewGrid::GetGridEffectiveBounds() const {
|
||||
}
|
||||
|
||||
gfx::Insets OverviewGrid::GetGridHorizontalPaddings() const {
|
||||
if (!features::IsForestFeatureEnabled()) {
|
||||
if (!IsForestFeatureEnabled()) {
|
||||
return gfx::Insets();
|
||||
}
|
||||
|
||||
@ -1690,7 +1691,7 @@ gfx::Insets OverviewGrid::GetGridHorizontalPaddings() const {
|
||||
}
|
||||
|
||||
gfx::Insets OverviewGrid::GetGridVerticalPaddings() const {
|
||||
const bool forest_enabled = features::IsForestFeatureEnabled();
|
||||
const bool forest_enabled = IsForestFeatureEnabled();
|
||||
|
||||
// Use compact paddings for partial overview.
|
||||
if (forest_enabled &&
|
||||
@ -2296,7 +2297,7 @@ void OverviewGrid::RefreshGridBounds(bool animate) {
|
||||
scoped_overview_wallpaper_clipper_->RefreshWallpaperClipBounds();
|
||||
}
|
||||
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
UpdateFeedbackButton();
|
||||
}
|
||||
}
|
||||
@ -3006,7 +3007,7 @@ bool OverviewGrid::FitWindowRectsInBounds(
|
||||
void OverviewGrid::MaybeCenterOverviewItems(
|
||||
std::vector<gfx::RectF>& out_window_rects,
|
||||
const base::flat_set<OverviewItemBase*>& ignored_items) {
|
||||
if (!features::IsForestFeatureEnabled() || out_window_rects.empty()) {
|
||||
if (!IsForestFeatureEnabled() || out_window_rects.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3211,7 +3212,7 @@ void OverviewGrid::OnBirchBarLayoutChanged(
|
||||
}
|
||||
|
||||
void OverviewGrid::RefreshDesksWidgets(bool visible) {
|
||||
if (!features::IsForestFeatureEnabled()) {
|
||||
if (!IsForestFeatureEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3384,7 +3385,7 @@ void OverviewGrid::UpdateFasterSplitViewWidget() {
|
||||
}
|
||||
|
||||
void OverviewGrid::UpdateFeedbackButton() {
|
||||
CHECK(features::IsForestFeatureEnabled());
|
||||
CHECK(IsForestFeatureEnabled());
|
||||
|
||||
if (SplitViewController::Get(root_window_)->InSplitViewMode()) {
|
||||
feedback_widget_.reset();
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "ash/accessibility/accessibility_controller.h"
|
||||
#include "ash/app_list/app_list_controller_impl.h"
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/frame_throttler/frame_throttling_controller.h"
|
||||
#include "ash/metrics/user_metrics_recorder.h"
|
||||
#include "ash/public/cpp/window_properties.h"
|
||||
@ -17,6 +16,7 @@
|
||||
#include "ash/screen_util.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/style/rounded_label_widget.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wm/desks/desk.h"
|
||||
#include "ash/wm/desks/desks_util.h"
|
||||
#include "ash/wm/desks/legacy_desk_bar_view.h"
|
||||
@ -204,7 +204,7 @@ void OverviewSession::Init(const aura::Window::Windows& windows,
|
||||
}
|
||||
|
||||
// Create this before the birch bar widget.
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
birch_bar_controller_ = std::make_unique<BirchBarController>(
|
||||
/*from_pine_service=*/enter_exit_overview_type_ ==
|
||||
OverviewEnterExitType::kPine);
|
||||
@ -1588,7 +1588,7 @@ void OverviewSession::OnSplitViewStateChanged(
|
||||
|
||||
// Entering or exiting splitview is unexpected behavior in a pine overview
|
||||
// session.
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
CHECK(!Shell::Get()->pine_controller()->pine_contents_data());
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "ash/test/ash_test_base.h"
|
||||
#include "ash/test/raster_scale_change_tracker.h"
|
||||
#include "ash/test/test_window_builder.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wallpaper/views/wallpaper_view.h"
|
||||
#include "ash/wallpaper/views/wallpaper_widget_controller.h"
|
||||
#include "ash/wm/desks/desk.h"
|
||||
@ -5401,7 +5402,7 @@ class FloatOverviewSessionTest : public OverviewTestBase {
|
||||
// it is not true on any of the root windows.
|
||||
bool IsFloatContainerNormalStacked() const {
|
||||
for (aura::Window* root : Shell::GetAllRootWindows()) {
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
// The float container should be the top-most child of the
|
||||
// `ShutdownScreenshotContainer` when the feature `ForestFeature` is
|
||||
// enabled.
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <utility>
|
||||
|
||||
#include "ash/accessibility/accessibility_controller.h"
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/public/cpp/shelf_config.h"
|
||||
#include "ash/public/cpp/window_properties.h"
|
||||
#include "ash/root_window_controller.h"
|
||||
@ -15,6 +14,7 @@
|
||||
#include "ash/shelf/shelf.h"
|
||||
#include "ash/shelf/shelf_layout_manager.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wm/mru_window_tracker.h"
|
||||
#include "ash/wm/overview/cleanup_animation_observer.h"
|
||||
#include "ash/wm/overview/delayed_animation_observer_impl.h"
|
||||
@ -261,7 +261,7 @@ gfx::Rect GetGridBoundsInScreen(
|
||||
const bool show_home_launcher =
|
||||
hotseat_state == HotseatState::kShownHomeLauncher;
|
||||
|
||||
const bool forest_enabled = features::IsForestFeatureEnabled();
|
||||
const bool forest_enabled = IsForestFeatureEnabled();
|
||||
|
||||
// Use the default hotseat size here to avoid the possible re-layout
|
||||
// due to the update in HotseatWidget::is_forced_dense_.
|
||||
|
@ -39,6 +39,9 @@ ScopedOverviewWallpaperClipper::ScopedOverviewWallpaperClipper(
|
||||
->wallpaper_widget_controller();
|
||||
auto* wallpaper_underlay_layer =
|
||||
wallpaper_widget_controller->wallpaper_underlay_layer();
|
||||
// TODO(http://b/333952534): Remove this check once `wallpaper_underlay_layer`
|
||||
// is always created.
|
||||
CHECK(wallpaper_underlay_layer);
|
||||
wallpaper_underlay_layer->SetVisible(true);
|
||||
|
||||
auto* wallpaper_view_layer =
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "ash/style/dark_light_mode_controller_impl.h"
|
||||
#include "ash/style/system_dialog_delegate_view.h"
|
||||
#include "ash/system/toast/toast_manager_impl.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wm/desks/desks_util.h"
|
||||
#include "ash/wm/overview/overview_controller.h"
|
||||
#include "ash/wm/overview/overview_grid.h"
|
||||
@ -213,7 +214,7 @@ void PineController::MaybeStartPineOverviewSessionDevAccelerator() {
|
||||
|
||||
void PineController::MaybeStartPineOverviewSession(
|
||||
std::unique_ptr<PineContentsData> pine_contents_data) {
|
||||
CHECK(features::IsForestFeatureEnabled());
|
||||
CHECK(IsForestFeatureEnabled());
|
||||
|
||||
if (OverviewController::Get()->InOverviewSession()) {
|
||||
return;
|
||||
@ -267,12 +268,19 @@ void PineController::OnOverviewModeEnding(OverviewSession* overview_session) {
|
||||
void PineController::OnOverviewModeEndingAnimationComplete(bool canceled) {
|
||||
// If `canceled` is true, overview was reentered before the exit animations
|
||||
// were finished. `in_pine_` will be reset the next time overview ends.
|
||||
if (canceled || !in_pine_ || !features::IsForestFeatureEnabled()) {
|
||||
if (canceled || !in_pine_) {
|
||||
return;
|
||||
}
|
||||
|
||||
in_pine_ = false;
|
||||
|
||||
// In multi-user scenario, forest may have been available for the user that
|
||||
// started overview, but not for the current user. (Switching users ends
|
||||
// overview.)
|
||||
if (!IsForestFeatureEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
PrefService* prefs = GetActivePrefService();
|
||||
if (!prefs) {
|
||||
return;
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include "chrome/browser/ash/app_restore/full_restore_prefs.h"
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/constants/ash_pref_names.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/wm/window_restore/window_restore_util.h"
|
||||
#include "chrome/browser/prefs/session_startup_pref.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
@ -24,7 +24,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
static_cast<int>(RestoreOption::kAskEveryTime),
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF);
|
||||
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureFlagEnabled()) {
|
||||
registry->RegisterBooleanPref(prefs::kShouldShowPineOnboarding, true);
|
||||
registry->RegisterIntegerPref(prefs::kPineNudgeShownCount, 0);
|
||||
registry->RegisterTimePref(prefs::kPineNudgeLastShown, base::Time());
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "ash/glanceables/post_login_glanceables_metrics_recorder.h"
|
||||
#include "ash/public/cpp/notification_utils.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "ash/webui/settings/public/constants/routes.mojom.h"
|
||||
#include "ash/webui/settings/public/constants/setting.mojom-shared.h"
|
||||
#include "ash/wm/desks/templates/saved_desk_controller.h"
|
||||
@ -149,6 +150,7 @@ class DelegateImpl : public FullRestoreService::Delegate {
|
||||
// A unit test that does not override this default delegate may not have ash
|
||||
// shell.
|
||||
if (Shell::HasInstance()) {
|
||||
CHECK(Shell::Get()->pine_controller());
|
||||
Shell::Get()->pine_controller()->MaybeStartPineOverviewSession(
|
||||
std::move(pine_contents_data));
|
||||
}
|
||||
@ -158,6 +160,7 @@ class DelegateImpl : public FullRestoreService::Delegate {
|
||||
// A unit test that does not override this default delegate may not have ash
|
||||
// shell.
|
||||
if (Shell::HasInstance()) {
|
||||
CHECK(Shell::Get()->pine_controller());
|
||||
Shell::Get()->pine_controller()->MaybeEndPineOverviewSession();
|
||||
}
|
||||
}
|
||||
@ -310,7 +313,7 @@ void FullRestoreService::Init(bool& show_notification) {
|
||||
MaybeInitiateAdminTemplateAutoLaunch();
|
||||
break;
|
||||
case RestoreOption::kDoNotRestore:
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
MaybeShowPineOnboarding();
|
||||
}
|
||||
::full_restore::FullRestoreSaveHandler::GetInstance()->AllowSave();
|
||||
@ -503,8 +506,7 @@ void FullRestoreService::MaybeShowRestoreNotification(const std::string& id,
|
||||
}
|
||||
|
||||
// Do not show the notification if we have no restore data.
|
||||
if (!features::IsForestFeatureEnabled() &&
|
||||
!app_launch_handler_->HasRestoreData()) {
|
||||
if (!IsForestFeatureEnabled() && !app_launch_handler_->HasRestoreData()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -523,7 +525,7 @@ void FullRestoreService::MaybeShowRestoreNotification(const std::string& id,
|
||||
|
||||
const bool last_session_crashed = id == kRestoreForCrashNotificationId;
|
||||
if (!app_launch_handler_->HasRestoreData()) {
|
||||
CHECK(features::IsForestFeatureEnabled());
|
||||
CHECK(IsForestFeatureEnabled());
|
||||
MaybeShowPineOnboarding();
|
||||
return;
|
||||
}
|
||||
@ -543,7 +545,7 @@ void FullRestoreService::MaybeShowRestoreNotification(const std::string& id,
|
||||
->RecordPostLoginFullRestoreShown();
|
||||
}
|
||||
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
CHECK(delegate_);
|
||||
|
||||
if (crosapi::browser_util::IsLacrosEnabled()) {
|
||||
@ -828,10 +830,10 @@ void FullRestoreService::OnSessionInformationReceived(
|
||||
}
|
||||
|
||||
void FullRestoreService::MaybeShowPineOnboarding() {
|
||||
CHECK(features::IsForestFeatureEnabled());
|
||||
if (Shell::HasInstance()) {
|
||||
RestoreOption restore_pref = static_cast<RestoreOption>(
|
||||
profile_->GetPrefs()->GetInteger(prefs::kRestoreAppsAndPagesPrefName));
|
||||
CHECK(Shell::Get()->pine_controller());
|
||||
Shell::Get()->pine_controller()->MaybeShowPineOnboardingMessage(
|
||||
/*restore_on=*/restore_pref == RestoreOption::kAskEveryTime);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/public/cpp/app_list/app_list_types.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "chrome/browser/ash/file_manager/fileapi_util.h"
|
||||
#include "chrome/browser/ash/file_suggest/drive_file_suggestion_provider.h"
|
||||
@ -34,7 +35,7 @@ FileSuggestKeyedService::FileSuggestKeyedService(
|
||||
proto_.Init();
|
||||
|
||||
if (features::IsLauncherContinueSectionWithRecentsEnabled() ||
|
||||
features::IsForestFeatureEnabled()) {
|
||||
IsForestFeatureEnabled()) {
|
||||
drive_file_suggestion_provider_ =
|
||||
std::make_unique<DriveRecentFileSuggestionProvider>(
|
||||
profile, base::BindRepeating(
|
||||
|
@ -268,10 +268,6 @@ void UserSessionInitializer::OnUserSessionStarted(bool is_primary_user) {
|
||||
// Ensure that the `HoldingSpaceKeyedService` for `profile` is created.
|
||||
HoldingSpaceKeyedServiceFactory::GetInstance()->GetService(profile);
|
||||
|
||||
// Ensure that the `BirchKeyedService` for `profile` is created. It is created
|
||||
// one per user in a multiprofile session.
|
||||
BirchKeyedServiceFactory::GetInstance()->GetService(profile);
|
||||
|
||||
// Ensure that the `CalendarKeyedService` for `profile` is created. It is
|
||||
// created one per user in a multiprofile session.
|
||||
CalendarKeyedServiceFactory::GetInstance()->GetService(profile);
|
||||
@ -286,6 +282,10 @@ void UserSessionInitializer::OnUserSessionStarted(bool is_primary_user) {
|
||||
if (is_primary_user) {
|
||||
DCHECK_EQ(primary_profile_, profile);
|
||||
|
||||
// Ensure that the `BirchKeyedService` for `profile` is created. It is
|
||||
// created one per user in a multiprofile session.
|
||||
BirchKeyedServiceFactory::GetInstance()->GetService(profile);
|
||||
|
||||
// Ensure that PhoneHubManager and EcheAppManager are created for the
|
||||
// primary profile.
|
||||
phonehub::PhoneHubManagerFactory::GetForProfile(profile);
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/constants/notifier_catalogs.h"
|
||||
#include "ash/public/cpp/notification_utils.h"
|
||||
#include "ash/resources/vector_icons/vector_icons.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "base/metrics/user_metrics.h"
|
||||
#include "base/metrics/user_metrics_action.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -39,8 +39,7 @@ ReleaseNotesNotification::~ReleaseNotesNotification() {}
|
||||
|
||||
void ReleaseNotesNotification::MaybeShowReleaseNotes() {
|
||||
release_notes_storage_ = std::make_unique<ReleaseNotesStorage>(profile_);
|
||||
if (!release_notes_storage_->ShouldNotify() ||
|
||||
features::IsForestFeatureEnabled()) {
|
||||
if (!release_notes_storage_->ShouldNotify() || IsForestFeatureEnabled()) {
|
||||
return;
|
||||
}
|
||||
ShowReleaseNotesNotification();
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "chrome/browser/ash/system_web_apps/apps/help_app/help_app_notification_controller.h"
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/version.h"
|
||||
#include "chrome/browser/ash/release_notes/release_notes_notification.h"
|
||||
@ -66,7 +67,7 @@ void HelpAppNotificationController::MaybeShowReleaseNotesNotification() {
|
||||
features::kReleaseNotesNotificationAlwaysEligible)) {
|
||||
return;
|
||||
}
|
||||
if (features::IsForestFeatureEnabled()) {
|
||||
if (IsForestFeatureEnabled()) {
|
||||
return;
|
||||
}
|
||||
ReleaseNotesStorage release_notes_storage(profile_);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "ash/utility/forest_util.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "chrome/browser/ash/file_suggest/file_suggest_keyed_service_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
@ -39,7 +39,7 @@ BirchKeyedService* BirchKeyedServiceFactory::GetService(
|
||||
content::BrowserContext* context) {
|
||||
return static_cast<BirchKeyedService*>(
|
||||
GetInstance()->GetServiceForBrowserContext(
|
||||
context, /*create=*/features::IsForestFeatureEnabled()));
|
||||
context, /*create=*/IsForestFeatureEnabled()));
|
||||
}
|
||||
|
||||
std::unique_ptr<KeyedService>
|
||||
|
Reference in New Issue
Block a user