Skip to content

Commit

Permalink
Add Get more extension link to brave://settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bsclifton committed Aug 15, 2019
1 parent b295203 commit e4db2bc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_SETTINGS_MANAGE_EXTENSIONS_LABEL" desc="The label of manage extensions link in settings">
Manage extensions
</message>

<message name="IDS_SETTINGS_GET_MORE_EXTENSIONS_LABEL" desc="The label of get more extensions link in settings">
Get more extensions
</message>
<message name="IDS_SETTINGS_GET_MORE_EXTENSIONS_SUBLABEL" desc="The sub-label of get more extensions link in settings">
Open Web Store
</message>
<!-- Extensions page strings -->
<message name="IDS_MD_EXTENSIONS_BRAVE_ITEM_SOURCE_WEBSTORE" desc="The text to indicate that an extension is from the Web Extensions Store.">
Web Extensions Store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@
label="$i18n{manageExtensionsLabel}" on-click="openExtensionsPage_">
</cr-link-row>
</div>
<div class="settings-row" id="getMoreExtensionsRow">
<cr-link-row
label="$i18n{getMoreExtensionsLabel}"
sub-label="$i18n{getMoreExtensionsSubLabel}"
on-click="openWebStoreUrl_" external>
</cr-link-row>
</div>
<template is="dom-if" if="{{ showRestartToast }}">
<div id="needsRestart">
<div class="flex-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,9 @@ Polymer({
openExtensionsPage_: function() {
window.open("chrome://extensions", "_self");
},

openWebStoreUrl_: function() {
window.open(loadTimeData.getString('getMoreExtensionsUrl'));
},
});
})();
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void BraveAddLocalizedStrings(content::WebUIDataSource*, Profile*);
#include "brave/grit/brave_generated_resources.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "extensions/common/extension_urls.h"

#undef IDS_SETTINGS_EDIT_PERSON
#define IDS_SETTINGS_EDIT_PERSON IDS_SETTINGS_BRAVE_EDIT_PROFILE
Expand Down Expand Up @@ -146,12 +147,22 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source,
{"relaunchButtonLabel",
IDS_SETTINGS_RELAUNCH_BUTTON_LABEL},
{"manageExtensionsLabel",
IDS_SETTINGS_MANAGE_EXTENSIONS_LABEL}
IDS_SETTINGS_MANAGE_EXTENSIONS_LABEL},
{"getMoreExtensionsLabel",
IDS_SETTINGS_GET_MORE_EXTENSIONS_LABEL},
{"getMoreExtensionsSubLabel",
IDS_SETTINGS_GET_MORE_EXTENSIONS_SUBLABEL}
};
AddLocalizedStringsBulk(html_source, localized_strings,
base::size(localized_strings));
html_source->AddString("webRTCLearnMoreURL",
base::ASCIIToUTF16(kWebRTCLearnMoreURL));
html_source->AddString("getMoreExtensionsUrl",
base::ASCIIToUTF16(
google_util::AppendGoogleLocaleParam(
GURL(extension_urls::GetWebstoreExtensionsCategoryURL()),
g_browser_process->GetApplicationLocale())
.spec()));
}

void BraveAddResources(content::WebUIDataSource* html_source,
Expand Down

0 comments on commit e4db2bc

Please sign in to comment.