Skip to content

Commit

Permalink
Updates extensions store link language on the extensions page. Adds
Browse files Browse the repository at this point in the history
link to the store even if there are installed extensions.

Fixes brave/brave-browser#2497
Fixes brave/brave-browser#1013
  • Loading branch information
mkarolin committed Dec 13, 2018
1 parent 21806bb commit 884612c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_SETTINGS_BRAVE_SYNC_LINK_LABEL" desc="Brave Sync link label">
Access Brave Sync via
</message>
<!-- Extensions page strings -->
<message name="IDS_MD_EXTENSIONS_BRAVE_MORE_EXTENSIONS" desc="The message shown to the user on the Extensions settings page under the list of installed extensions.">
<ph name="BEGIN_LINK">&lt;a target="_blank" href="https://chrome.google.com/webstore/category/extensions"&gt;</ph>Looking for even more extensions?<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>
</message>
</messages>
<includes>
<include name="IDR_BRAVE_TAG_SERVICES_POLYFILL" file="resources/js/tag_services_polyfill.js" type="BINDATA" />
Expand Down
10 changes: 5 additions & 5 deletions app/md_extensions_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@
<message name="IDS_MD_EXTENSIONS_ITEM_EXTENSION_WEBSITE" desc="Label for button to go to the website the extension developer specified.">
Open extension website
</message>
<message name="IDS_MD_EXTENSIONS_ITEM_CHROME_WEB_STORE" desc="Label for button to visit the Brave web store.">
View in Brave Web Store
<message name="IDS_MD_EXTENSIONS_ITEM_CHROME_WEB_STORE" desc="Label for button to visit the Web Extensions Store.">
View in Web Extensions Store
</message>
<message name="IDS_MD_EXTENSIONS_ITEM_OPTIONS" desc="The label on the button to open an extension options page.">
Extension options
Expand All @@ -200,8 +200,8 @@
<message name="IDS_MD_EXTENSIONS_ITEM_SOURCE_UNPACKED" desc="The text to indicate that an extension is loaded as an unpacked extension, as is done by developers.">
Unpacked extension
</message>
<message name="IDS_MD_EXTENSIONS_ITEM_SOURCE_WEBSTORE" desc="The text to indicate that an extension is from the Brave Web Store.">
Brave Web Store
<message name="IDS_MD_EXTENSIONS_ITEM_SOURCE_WEBSTORE" desc="The text to indicate that an extension is from the Web Extensions Store.">
Web Extensions Store
</message>
<message name="IDS_MD_EXTENSIONS_ITEM_VERSION" desc="The label above an extension's version.">
Version
Expand All @@ -222,7 +222,7 @@
Retry
</message>
<message name="IDS_MD_EXTENSIONS_NO_INSTALLED_ITEMS" desc="The message shown to the user on the Extensions settings page when there are no extensions or apps installed.">
Find extensions and themes in the <ph name="BEGIN_LINK">&lt;a target="_blank" href="https://chrome.google.com/webstore/category/extensions"&gt;</ph>Brave Web Store<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>
You don't have any extensions yet. Would you like to <ph name="BEGIN_LINK">&lt;a target="_blank" href="https://chrome.google.com/webstore/category/extensions"&gt;</ph>install some<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>?
</message>
<message name="IDS_MD_EXTENSIONS_NO_DESCRIPTION" desc="The message shown to the user when an extension does not have any description.">
No description provided
Expand Down
29 changes: 29 additions & 0 deletions chromium_src/chrome/browser/ui/webui/extensions/extensions_ui.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* 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 http://mozilla.org/MPL/2.0/. */

#include "brave/grit/brave_generated_resources.h"
#include "content/public/browser/web_ui_data_source.h"

// Forward declarations needed due to extensions_ui.cc being patched with this
// function name.
namespace extensions {
namespace {
void BraveAddLocalizedStrings(content::WebUIDataSource* html_source);
} // namespace
} // namespace extensions

#include "../../../../../../chrome/browser/ui/webui/extensions/extensions_ui.cc"

namespace extensions {

namespace {

void BraveAddLocalizedStrings(content::WebUIDataSource* html_source) {
html_source->AddLocalizedString("moreExtensions",
IDS_MD_EXTENSIONS_BRAVE_MORE_EXTENSIONS);
}

} // namespace

} // namespace extensions
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/chrome/browser/resources/md_extensions/item_list.html b/chrome/browser/resources/md_extensions/item_list.html
index 90244de120cf8fda71002f535810619b1e8aeb3e..84450aca34abf7b55e1289b8716b81d5323e6ec0 100644
--- a/chrome/browser/resources/md_extensions/item_list.html
+++ b/chrome/browser/resources/md_extensions/item_list.html
@@ -106,6 +106,13 @@
</template>
</div>
</div>
+ <div id="more-items" class="empty-list-message" style="margin-top: 32px;"
+ hidden$="[[shouldShowEmptyItemsMessage_(
+ apps.length, extensions.length)]]">
+ <span>
+ $i18nRaw{moreExtensions}
+ </span>
+ </div>
</div>
</div>
</template>
12 changes: 12 additions & 0 deletions patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc
index 393653d66928e306bfdf479d6e0fd194655e783c..cc330c1194b80b775e4de82c19d7aa373b8f2270 100644
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -348,6 +348,7 @@ ExtensionsUI::ExtensionsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
base::Bind(&ExtensionsUI::OnDevModeChanged, base::Unretained(this)));

source = CreateMdExtensionsSource(*in_dev_mode_);
+ BraveAddLocalizedStrings(source);

#if defined(OS_CHROMEOS)
auto kiosk_app_handler = std::make_unique<chromeos::KioskAppsHandler>(

0 comments on commit 884612c

Please sign in to comment.