Files
cdesouza-chromium 07b587a892 [CodeHealth] Use BASE_FEATURE with two args where possible (#32041)
This PR corrects several places where `BASE_FEATURE` is being used to
rely on the two-arg variant of this macro. This particular PR has no
functional changes, and the only feature declarations affected are the
ones for which the feature-name constant, and the actual value are
identical.

The particular issue for this will be left open so subsequent work for
the other features can be followed up on.

Bug: https://github.com/brave/brave-browser/issues/50492
2025-10-27 18:56:50 +00:00

34 lines
1.0 KiB
C++

/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "brave/components/sidebar/common/features.h"
namespace sidebar::features {
BASE_FEATURE(kSidebarShowAlwaysOnStable,
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kSidebarWebPanel,
base::FEATURE_DISABLED_BY_DEFAULT);
const base::FeatureParam<bool> kOpenOneShotLeoPanel{
&kSidebarShowAlwaysOnStable,
/*name=*/"open_one_shot_leo_panel",
/*default_value=*/false};
SidebarDefaultMode GetSidebarDefaultMode() {
if (base::FeatureList::IsEnabled(kSidebarShowAlwaysOnStable)) {
if (kOpenOneShotLeoPanel.Get()) {
return SidebarDefaultMode::kOnOneShot;
} else {
return SidebarDefaultMode::kAlwaysOn;
}
} else {
return SidebarDefaultMode::kOff;
}
}
} // namespace sidebar::features