Commit f99198c0 authored by rbpotter's avatar rbpotter Committed by Commit Bot

WebUI: Delete SetupBundledWebUIDataSource()

With the update of OS settings to generate_grd, this method is no
longer used.

Bug: 1132403
Change-Id: Id06f6249b05bebcc72eb22b417d0334bc4d5a708
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505936Reviewed-by: default avatardpapad <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821828}
parent 7cfbdfe6
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "chrome/browser/ui/webui/webui_util.h" #include "chrome/browser/ui/webui/webui_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/common/buildflags.h"
#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_data_source.h"
#include "services/network/public/mojom/content_security_policy.mojom.h" #include "services/network/public/mojom/content_security_policy.mojom.h"
#include "ui/base/webui/web_ui_util.h" #include "ui/base/webui/web_ui_util.h"
...@@ -57,17 +56,6 @@ void SetupWebUIDataSource(content::WebUIDataSource* source, ...@@ -57,17 +56,6 @@ void SetupWebUIDataSource(content::WebUIDataSource* source,
source->AddResourcePath("", default_resource); source->AddResourcePath("", default_resource);
} }
#if BUILDFLAG(OPTIMIZE_WEBUI)
void SetupBundledWebUIDataSource(content::WebUIDataSource* source,
base::StringPiece bundled_path,
int bundle,
int default_resource) {
SetupPolymer3Defaults(source);
source->AddResourcePath(bundled_path, bundle);
source->AddResourcePath("", default_resource);
}
#endif
void AddLocalizedStringsBulk(content::WebUIDataSource* html_source, void AddLocalizedStringsBulk(content::WebUIDataSource* html_source,
base::span<const LocalizedString> strings) { base::span<const LocalizedString> strings) {
for (const auto& str : strings) for (const auto& str : strings)
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/containers/span.h" #include "base/containers/span.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "chrome/common/buildflags.h"
struct GritResourceMap; struct GritResourceMap;
...@@ -35,15 +34,6 @@ void SetupWebUIDataSource(content::WebUIDataSource* source, ...@@ -35,15 +34,6 @@ void SetupWebUIDataSource(content::WebUIDataSource* source,
const std::string& generated_path, const std::string& generated_path,
int default_resource); int default_resource);
#if BUILDFLAG(OPTIMIZE_WEBUI)
// Same as SetupWebUIDataSource, but for a bundled page; this adds only the
// bundle and the default resource to |source|.
void SetupBundledWebUIDataSource(content::WebUIDataSource* source,
base::StringPiece bundled_path,
int bundle,
int default_resource);
#endif
// Calls content::WebUIDataSource::AddLocalizedString() in a for-loop for // Calls content::WebUIDataSource::AddLocalizedString() in a for-loop for
// |strings|. Reduces code size vs. reimplementing the same for-loop. // |strings|. Reduces code size vs. reimplementing the same for-loop.
void AddLocalizedStringsBulk(content::WebUIDataSource* html_source, void AddLocalizedStringsBulk(content::WebUIDataSource* html_source,
......
...@@ -407,12 +407,12 @@ resource map can be added as follows: ...@@ -407,12 +407,12 @@ resource map can be added as follows:
``` ```
<a name="SetupWebUIDataSource"></a> <a name="SetupWebUIDataSource"></a>
### webui::SetupWebUIDataSource() and webui::SetupBundledWebUIDataSource() ### webui::SetupWebUIDataSource()
These methods perform common configuration tasks on a data source for a Web UI This method performs common configuration tasks on a data source for a Web UI
that uses JS modules. When creating a Web UI that uses JS modules, use these that uses JS modules. When creating a Web UI that uses JS modules, use this
utilities instead of duplicating the configuration steps they perform elsewhere. utility instead of duplicating the configuration steps it performs elsewhere.
Specific setup steps performed by these utilities include: Specific setup steps include:
* Setting the content security policy to allow the data source to load only * Setting the content security policy to allow the data source to load only
resources from its own host (e.g. chrome://history), chrome://resources, and resources from its own host (e.g. chrome://history), chrome://resources, and
...@@ -422,13 +422,7 @@ Specific setup steps performed by these utilities include: ...@@ -422,13 +422,7 @@ Specific setup steps performed by these utilities include:
* Adding the test loader files to the data source, so that test files can be * Adding the test loader files to the data source, so that test files can be
loaded as JS modules. loaded as JS modules.
* Setting the resource to load for the empty path. * Setting the resource to load for the empty path.
* Adding all resources from a GritResourceMap.
The version for non-bundled UIs (<code>SetupWebUIDataSource()</code>) also adds
all resources in a GritResourceMap.
The version for bundled UIs (<code>SetupBundledWebUIDataSource()</code>) adds
a single specified bundled resource. Note that this version is only defined when
the optimize_webui build flag is enabled.
## Browser (C++) &rarr; Renderer (JS) ## Browser (C++) &rarr; Renderer (JS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment