-
Notifications
You must be signed in to change notification settings - Fork 892
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates extensions store link language on the extensions page. Adds
link to the store even if there are installed extensions. Fixes brave/brave-browser#2497 Fixes brave/brave-browser#1013
- Loading branch information
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
chromium_src/chrome/browser/ui/webui/extensions/extensions_ui.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* 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 "chrome/grit/generated_resources.h" | ||
#include "content/public/browser/web_ui_data_source.h" | ||
|
||
// These are defined in generated_resources.h, but since we are including it | ||
// here the original extensions_ui.cc shouldn't include it again and the | ||
// redefined values will be used. | ||
#undef IDS_MD_EXTENSIONS_ITEM_CHROME_WEB_STORE | ||
#define IDS_MD_EXTENSIONS_ITEM_CHROME_WEB_STORE \ | ||
IDS_MD_EXTENSIONS_BRAVE_ITEM_CHROME_WEB_STORE | ||
#undef IDS_MD_EXTENSIONS_ITEM_SOURCE_WEBSTORE | ||
#define IDS_MD_EXTENSIONS_ITEM_SOURCE_WEBSTORE \ | ||
IDS_MD_EXTENSIONS_BRAVE_ITEM_SOURCE_WEBSTORE | ||
#undef IDS_MD_EXTENSIONS_NO_INSTALLED_ITEMS | ||
#define IDS_MD_EXTENSIONS_NO_INSTALLED_ITEMS \ | ||
IDS_MD_EXTENSIONS_BRAVE_NO_INSTALLED_ITEMS | ||
|
||
// 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 |
18 changes: 18 additions & 0 deletions
18
patches/chrome-browser-resources-md_extensions-item_list.html.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
13 changes: 13 additions & 0 deletions
13
patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc | ||
index 1b7560672a3608c7331799ce516d63066bf4d068..c3480b2cdcdf6950a6a8c136f3a8dabde5e4a615 100644 | ||
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc | ||
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc | ||
@@ -285,6 +285,8 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) { | ||
AddLocalizedStringsBulk(source, localized_strings, | ||
base::size(localized_strings)); | ||
|
||
+ BraveAddLocalizedStrings(source); | ||
+ | ||
source->AddString("errorLinesNotShownSingular", | ||
l10n_util::GetPluralStringFUTF16( | ||
IDS_MD_EXTENSIONS_ERROR_LINES_NOT_SHOWN, 1)); |