[infobar] Refactor BraveConfirmInfoBar (1/N): drop dev channel infobar (#36342)

First step of the BraveConfirmInfoBar refactor.

Before refactoring BraveConfirmInfoBar, removed unused BraveConfirmInfoBar subclass.

Dev channel deprecation infobar: not used anymore. Remove.

Resolves - subtask of brave/brave-browser#48822
This commit is contained in:
Simon Hong
2026-05-13 07:24:46 +09:00
committed by GitHub
parent 3793bdd875
commit aa2ad1dfbd
7 changed files with 1 additions and 155 deletions
-4
View File
@@ -429,10 +429,6 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
Open link in Brave private window with Tor
</message>
</if>
<!-- Dev channel deprecation infobar -->
<message name="IDS_DEV_CHANNEL_DEPRECATION_INFOBAR_MESSAGE" desc="The text label of dev channel deprecation announcement.">
Beginning on December 1, 2023, Brave Dev channel will no longer receive browser updates. We recommend users migrate to the Nightly, Beta, or Release versions of Brave.
</message>
<!-- Mac Menubar Menus -->
<if expr="is_macosx">
<message name="IDS_REPORT_BROKEN_SITE_MAC" desc="The Mac menu item to report a broken site in the Help menu.">
@@ -1,65 +0,0 @@
/* Copyright (c) 2023 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/browser/infobars/dev_channel_deprecation_infobar_delegate.h"
#include <memory>
#include "brave/browser/infobars/brave_confirm_infobar_creator.h"
#include "brave/components/constants/url_constants.h"
#include "brave/grit/brave_generated_resources.h"
#include "chrome/common/channel_info.h"
#include "components/infobars/core/infobar.h"
#include "components/strings/grit/components_strings.h"
#include "components/version_info/channel.h"
#include "ui/base/l10n/l10n_util.h"
// static
void DevChannelDeprecationInfoBarDelegate::CreateIfNeeded(
infobars::InfoBarManager* infobar_manager) {
if (chrome::GetChannel() == version_info::Channel::DEV) {
infobar_manager->AddInfoBar(
CreateBraveConfirmInfoBar(std::unique_ptr<BraveConfirmInfoBarDelegate>(
new DevChannelDeprecationInfoBarDelegate())));
}
}
DevChannelDeprecationInfoBarDelegate::~DevChannelDeprecationInfoBarDelegate() =
default;
DevChannelDeprecationInfoBarDelegate::DevChannelDeprecationInfoBarDelegate() =
default;
infobars::InfoBarDelegate::InfoBarIdentifier
DevChannelDeprecationInfoBarDelegate::GetIdentifier() const {
return DEV_CHANNEL_DEPRECATION_INFOBAR_DELEGATE;
}
std::u16string DevChannelDeprecationInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringUTF16(IDS_DEV_CHANNEL_DEPRECATION_INFOBAR_MESSAGE);
}
int DevChannelDeprecationInfoBarDelegate::GetButtons() const {
return BUTTON_NONE;
}
std::vector<int> DevChannelDeprecationInfoBarDelegate::GetButtonsOrder() const {
return {};
}
bool DevChannelDeprecationInfoBarDelegate::ShouldExpire(
const NavigationDetails& details) const {
// Since deprecation infobar communicates critical state, it should persist
// until explicitly dismissed.
return false;
}
std::u16string DevChannelDeprecationInfoBarDelegate::GetLinkText() const {
return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
}
GURL DevChannelDeprecationInfoBarDelegate::GetLinkURL() const {
return GURL(kDevChannelDeprecationLearnMoreUrl);
}
@@ -1,38 +0,0 @@
/* Copyright (c) 2023 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/. */
#ifndef BRAVE_BROWSER_INFOBARS_DEV_CHANNEL_DEPRECATION_INFOBAR_DELEGATE_H_
#define BRAVE_BROWSER_INFOBARS_DEV_CHANNEL_DEPRECATION_INFOBAR_DELEGATE_H_
#include <vector>
#include "brave/components/infobars/core/brave_confirm_infobar_delegate.h"
class DevChannelDeprecationInfoBarDelegate
: public BraveConfirmInfoBarDelegate {
public:
static void CreateIfNeeded(infobars::InfoBarManager* infobar_manager);
DevChannelDeprecationInfoBarDelegate(
const DevChannelDeprecationInfoBarDelegate&) = delete;
DevChannelDeprecationInfoBarDelegate& operator=(
const DevChannelDeprecationInfoBarDelegate&) = delete;
~DevChannelDeprecationInfoBarDelegate() override;
private:
DevChannelDeprecationInfoBarDelegate();
// BraveConfirmInfoBarDelegate overrides:
infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
std::u16string GetMessageText() const override;
int GetButtons() const override;
std::vector<int> GetButtonsOrder() const override;
bool ShouldExpire(const NavigationDetails& details) const override;
std::u16string GetLinkText() const override;
GURL GetLinkURL() const override;
};
#endif // BRAVE_BROWSER_INFOBARS_DEV_CHANNEL_DEPRECATION_INFOBAR_DELEGATE_H_
-2
View File
@@ -15,8 +15,6 @@ if (!is_android) {
"//brave/browser/infobars/brave_confirm_p3a_infobar_delegate.h",
"//brave/browser/infobars/brave_sync_account_deleted_infobar_delegate.cc",
"//brave/browser/infobars/brave_sync_account_deleted_infobar_delegate.h",
"//brave/browser/infobars/dev_channel_deprecation_infobar_delegate.cc",
"//brave/browser/infobars/dev_channel_deprecation_infobar_delegate.h",
"//brave/browser/infobars/request_otr_infobar_delegate.cc",
"//brave/browser/infobars/request_otr_infobar_delegate.h",
"//brave/browser/infobars/sync_cannot_run_infobar_delegate.cc",
@@ -3,8 +3,6 @@
* 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 "base/check.h"
#include "brave/browser/infobars/dev_channel_deprecation_infobar_delegate.h"
#include "brave/browser/ui/startup/brave_obsolete_system_infobar_delegate.h"
#include "build/build_config.h"
#include "chrome/browser/ui/session_crashed_bubble.h"
@@ -24,7 +22,6 @@ class BraveGoogleKeysInfoBarDelegate {
#define ShowIfNotOffTheRecordProfile ShowIfNotOffTheRecordProfileBrave
#define GoogleApiKeysInfoBarDelegate BraveGoogleKeysInfoBarDelegate
#define AddInfoBarsIfNecessary AddInfoBarsIfNecessary_ChromiumImpl
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#define ObsoleteSystemInfoBarDelegate BraveObsoleteSystemInfoBarDelegate
@@ -36,43 +33,5 @@ class BraveGoogleKeysInfoBarDelegate {
#undef ObsoleteSystemInfoBarDelegate
#endif
#undef AddInfoBarsIfNecessary
#undef GoogleApiKeysInfoBarDelegate
#undef ShowIfNotOffTheRecordProfile
void AddInfoBarsIfNecessary(BrowserWindowInterface* browser,
Profile* profile,
const base::CommandLine& startup_command_line,
chrome::startup::IsFirstRun is_first_run,
bool is_web_app,
bool is_post_crash_launch,
bool was_restarted) {
AddInfoBarsIfNecessary_ChromiumImpl(browser, profile, startup_command_line,
is_first_run, is_web_app,
is_post_crash_launch, was_restarted);
TabStripModel* tab_strip_model = browser->GetTabStripModel();
if (!browser || !profile || tab_strip_model->count() == 0) {
return;
}
if (IsKioskModeEnabled()) {
return;
}
if (!startup_command_line.HasSwitch(switches::kTestType) &&
!IsAutomationEnabled()) {
static bool infobars_shown = false;
if (infobars_shown) {
return;
}
infobars_shown = true;
content::WebContents* web_contents =
tab_strip_model->GetActiveWebContents();
DCHECK(web_contents);
infobars::ContentInfoBarManager* infobar_manager =
infobars::ContentInfoBarManager::FromWebContents(web_contents);
DevChannelDeprecationInfoBarDelegate::CreateIfNeeded(infobar_manager);
}
}
@@ -17,7 +17,6 @@
WEB_DISCOVERY_INFOBAR_DELEGATE = 506, \
BRAVE_SYNC_ACCOUNT_DELETED_INFOBAR = 507, \
BRAVE_REQUEST_OTR_INFOBAR_DELEGATE = 508, \
DEV_CHANNEL_DEPRECATION_INFOBAR_DELEGATE = 509, \
SEARCH_RESULT_AD_CLICKED_INFOBAR_DELEGATE = 510, \
NEW_TAB_TAKEOVER_INFOBAR_DELEGATE = 511, BRAVE_PSST_INFOBAR_DELEGATE = 512,
@@ -25,6 +24,7 @@
// WAYBACK_MACHINE_INFOBAR_DELEGATE = 502
// SYNC_V2_MIGRATE_INFOBAR_DELEGATE = 503
// ANDROID_SYSTEM_SYNC_DISABLED_INFOBAR = 504
// DEV_CHANNEL_DEPRECATION_INFOBAR_DELEGATE = 509
#include <components/infobars/core/infobar_delegate.h> // IWYU pragma: export
-4
View File
@@ -30,10 +30,6 @@ inline constexpr char kBraveSearchHost[] = "search.brave.com";
inline constexpr char kWidevineLearnMoreUrl[] =
"https://support.brave.app/hc/en-us/articles/"
"360023851591-How-do-I-view-DRM-protected-content-";
inline constexpr char kDevChannelDeprecationLearnMoreUrl[] =
"https://support.brave.app/hc/en-us/articles/"
"17924707453581-How-do-I-migrate-my-Brave-Dev-data-to-another-channel-"
"Nightly-Beta-Release-";
inline constexpr char kDownloadBraveUrl[] = "https://www.brave.com/download";
inline constexpr char kAIChatAboutUrl[] = "https://brave.com/leo/";