-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2384 from brave/fix-ui-generated-resources-dep
Add strings for NavigationBar on relevant WebUI data sources directly --- Uplift of #2384 Fixes brave/brave-browser#4343
- Loading branch information
Showing
14 changed files
with
144 additions
and
38 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
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
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
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,23 @@ | ||
// Copyright (c) 2019 The Brave Authors | ||
// 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/browser/ui/webui/navigation_bar_data_provider.h" | ||
|
||
#include "chrome/grit/generated_resources.h" | ||
#include "components/strings/grit/components_strings.h" | ||
#include "content/public/browser/web_ui_data_source.h" | ||
|
||
// static | ||
void NavigationBarDataProvider::Initialize(content::WebUIDataSource* source) { | ||
source->AddLocalizedString( | ||
"brToolbarSettingsTitle", IDS_SETTINGS_SETTINGS); | ||
source->AddLocalizedString( | ||
"brToolbarBookmarksTitle", IDS_BOOKMARK_MANAGER_TITLE); | ||
source->AddLocalizedString( | ||
"brToolbarDownloadsTitle", IDS_DOWNLOAD_TITLE); | ||
source->AddLocalizedString( | ||
"brToolbarHistoryTitle", IDS_HISTORY_TITLE); | ||
} | ||
|
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,20 @@ | ||
// Copyright (c) 2019 The Brave Authors | ||
// 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/. | ||
|
||
#ifndef BRAVE_BROWSER_UI_WEBUI_NAVIGATION_BAR_DATA_PROVIDER_H | ||
#define BRAVE_BROWSER_UI_WEBUI_NAVIGATION_BAR_DATA_PROVIDER_H | ||
|
||
namespace content { | ||
class WebUIDataSource; | ||
} | ||
|
||
class NavigationBarDataProvider { | ||
public: | ||
// Sets load-time constants on |source|. This handles a flicker-free initial | ||
// page load (i.e. loadTimeData.getString('brToolbarSettingsTitle')). | ||
static void Initialize(content::WebUIDataSource* source); | ||
}; | ||
|
||
#endif |
17 changes: 17 additions & 0 deletions
17
chromium_src/chrome/browser/ui/webui/bookmarks/bookmarks_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,17 @@ | ||
// Copyright (c) 2019 The Brave Authors | ||
// 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/browser/ui/webui/navigation_bar_data_provider.h" | ||
|
||
namespace { | ||
|
||
void BraveCustomizeBookmarksDataSource(content::WebUIDataSource* source) { | ||
NavigationBarDataProvider::Initialize(source); | ||
} | ||
|
||
} // namespace | ||
|
||
#include "../../../../../../chrome/browser/ui/webui/bookmarks/bookmarks_ui.cc" | ||
|
17 changes: 17 additions & 0 deletions
17
chromium_src/chrome/browser/ui/webui/downloads/downloads_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,17 @@ | ||
// Copyright (c) 2019 The Brave Authors | ||
// 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/browser/ui/webui/navigation_bar_data_provider.h" | ||
|
||
namespace { | ||
|
||
void BraveCustomizeDownloadsDataSource(content::WebUIDataSource* source) { | ||
NavigationBarDataProvider::Initialize(source); | ||
} | ||
|
||
} // namespace | ||
|
||
#include "../../../../../../chrome/browser/ui/webui/downloads/downloads_ui.cc" // NOLINT | ||
|
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
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,17 @@ | ||
// Copyright (c) 2019 The Brave Authors | ||
// 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/browser/ui/webui/navigation_bar_data_provider.h" | ||
|
||
namespace { | ||
|
||
void BraveCustomizeHistoryDataSource(content::WebUIDataSource* source) { | ||
NavigationBarDataProvider::Initialize(source); | ||
} | ||
|
||
} // namespace | ||
|
||
#include "../../../../../chrome/browser/ui/webui/history_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
12 changes: 12 additions & 0 deletions
12
patches/chrome-browser-ui-webui-bookmarks-bookmarks_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,12 @@ | ||
diff --git a/chrome/browser/ui/webui/bookmarks/bookmarks_ui.cc b/chrome/browser/ui/webui/bookmarks/bookmarks_ui.cc | ||
index 0542e022aeaedc240cf0bc79b9acebfe121fcc4d..ac9fe90cb2d96fa9850c066ae33630a60bf4ba22 100644 | ||
--- a/chrome/browser/ui/webui/bookmarks/bookmarks_ui.cc | ||
+++ b/chrome/browser/ui/webui/bookmarks/bookmarks_ui.cc | ||
@@ -45,6 +45,7 @@ content::WebUIDataSource* CreateBookmarksUIHTMLSource(Profile* profile) { | ||
content::WebUIDataSource* source = | ||
content::WebUIDataSource::Create(chrome::kChromeUIBookmarksHost); | ||
|
||
+ BraveCustomizeBookmarksDataSource(source); | ||
// Build an Accelerator to describe undo shortcut | ||
// NOTE: the undo shortcut is also defined in bookmarks/command_manager.js | ||
// TODO(b/893033): de-duplicate shortcut by moving all shortcut definitions |
12 changes: 12 additions & 0 deletions
12
patches/chrome-browser-ui-webui-downloads-downloads_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,12 @@ | ||
diff --git a/chrome/browser/ui/webui/downloads/downloads_ui.cc b/chrome/browser/ui/webui/downloads/downloads_ui.cc | ||
index 9f595a7bbb7adc1e42fd7eac31d0b8819deda532..41bfbeddcc010e8c76cf198c64d428d274b44137 100644 | ||
--- a/chrome/browser/ui/webui/downloads/downloads_ui.cc | ||
+++ b/chrome/browser/ui/webui/downloads/downloads_ui.cc | ||
@@ -47,6 +47,7 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) { | ||
content::WebUIDataSource* source = | ||
content::WebUIDataSource::Create(chrome::kChromeUIDownloadsHost); | ||
|
||
+ BraveCustomizeDownloadsDataSource(source); | ||
source->AddLocalizedString("title", IDS_DOWNLOAD_TITLE); | ||
source->AddLocalizedString("searchResultsPlural", IDS_SEARCH_RESULTS_PLURAL); | ||
source->AddLocalizedString("searchResultsSingular", |
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,12 @@ | ||
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc | ||
index b6b6f4f7aa79a1c3a44a187c1f618e10194442bd..09a0d991a87ff90c84678ac0f6325a8e5076560a 100644 | ||
--- a/chrome/browser/ui/webui/history_ui.cc | ||
+++ b/chrome/browser/ui/webui/history_ui.cc | ||
@@ -56,6 +56,7 @@ content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) { | ||
content::WebUIDataSource* source = | ||
content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); | ||
|
||
+ BraveCustomizeHistoryDataSource(source); | ||
// Localized strings (alphabetical order). | ||
source->AddLocalizedString("actionMenuDescription", | ||
IDS_HISTORY_ACTION_MENU_DESCRIPTION); |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
group("chromium_deps") { | ||
deps = [ | ||
"//brave/ui/webui/resources", | ||
"//brave/app:brave_generated_resources_grit", | ||
] | ||
} |