Skip to content

Commit

Permalink
Updated sidebar settings button target url
Browse files Browse the repository at this point in the history
fix brave/brave-browser#21060

Introduced new IDS_SETTINGS_SIDEBAR_SHOW_OPTION_TITLE.
Although it uses same string with IDS_SIDEBAR_SHOW_OPTION_TITLE,
made different string id to prevent future regression.
IDS_SIDEBAR_SHOW_OPTION_TITLE was shared by many other UI such as app menu
or context menu.
  • Loading branch information
simonhong authored and muliswilliam committed Mar 16, 2022
1 parent 213b5a9 commit 5502170
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,9 @@ Are you sure you want to do this?
<message name="IDS_SIDEBAR_SHOW_OPTION_TITLE" desc="Title of sidebar show option menu">
Show Sidebar
</message>
<message name="IDS_SETTINGS_SIDEBAR_SHOW_OPTION_TITLE" desc="Title of sidebar show option menu in settings">
Show Sidebar
</message>
<message name="IDS_SIDEBAR_SHOW_OPTION_ALWAYS" desc="Label for always show sidebar option">
Always
</message>
Expand Down
4 changes: 2 additions & 2 deletions browser/ui/views/sidebar/sidebar_control_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "brave/components/sidebar/sidebar_service.h"
#include "brave/grit/brave_generated_resources.h"
#include "brave/grit/brave_theme_resources.h"
#include "chrome/common/webui_url_constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/resource/resource_bundle.h"
Expand Down Expand Up @@ -202,7 +201,8 @@ void SidebarControlView::AddChildViews() {
void SidebarControlView::OnButtonPressed(views::View* view) {
if (view == sidebar_settings_view_) {
browser_->sidebar_controller()->LoadAtTab(
GURL(chrome::kChromeUISettingsURL));
GURL("brave://settings?search=" +
l10n_util::GetStringUTF8(IDS_SETTINGS_SIDEBAR_SHOW_OPTION_TITLE)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source,
{"appearanceBraveDefaultImagesOptionLabel",
IDS_SETTINGS_APPEARANCE_SETTINGS_BRAVE_DEFAULT_IMAGES_OPTION_LABEL},
#if BUILDFLAG(ENABLE_SIDEBAR)
{"appearanceSettingsShowOptionTitle", IDS_SIDEBAR_SHOW_OPTION_TITLE},
{"appearanceSettingsShowOptionTitle",
IDS_SETTINGS_SIDEBAR_SHOW_OPTION_TITLE},
{"appearanceSettingsShowOptionAlways", IDS_SIDEBAR_SHOW_OPTION_ALWAYS},
{"appearanceSettingsShowOptionMouseOver",
IDS_SIDEBAR_SHOW_OPTION_MOUSEOVER},
Expand Down

0 comments on commit 5502170

Please sign in to comment.