Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: content/browser/loader/navigation_url_loader_network_service.cc

Issue 2867853002: Make the new WebUI's code handle all webui schemes, instead of just chrome://. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/navigation_url_loader_network_service.cc
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc
index e82a39da4e07f37a329fdbcd5124fbf3330ce2d4..be7fcf142da85e587b9c028dafeb1e7041470926 100644
--- a/content/browser/loader/navigation_url_loader_network_service.cc
+++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -15,6 +15,7 @@
#include "content/browser/loader/navigation_resource_handler.h"
#include "content/browser/loader/navigation_resource_throttle.h"
#include "content/browser/loader/navigation_url_loader_delegate.h"
+#include "content/browser/webui/url_data_manager_backend.h"
#include "content/browser/webui/web_ui_url_loader_factory.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/global_request_id.h"
@@ -214,7 +215,9 @@ void NavigationURLLoaderNetworkService::StartURLRequest(
// This is fine for now since the only user of this is WebUI which doesn't
// need this, but we'll have to fix this when other consumers come up.
mojom::URLLoaderFactoryPtr factory_ptr;
- if (request->url.SchemeIs(kChromeUIScheme)) {
+ const auto& schemes = URLDataManagerBackend::GetWebUISchemes();
+ if (std::find(schemes.begin(), schemes.end(), request->url.scheme()) !=
+ schemes.end()) {
FrameTreeNode* frame_tree_node =
FrameTreeNode::GloballyFindByID(request_info_->frame_tree_node_id);
factory_ptr = GetWebUIURLLoader(frame_tree_node);
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698