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

Unified Diff: content/browser/frame_host/render_frame_host_impl.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 | « no previous file | content/browser/loader/navigation_url_loader_network_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index d0ac34fb6dad26ca0f0951087e3fb6d7ee1551f8..163c793970f2e969571d12b387879af46d471f21 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -58,6 +58,7 @@
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/shared_worker/shared_worker_service_impl.h"
#include "content/browser/websockets/websocket_manager.h"
+#include "content/browser/webui/url_data_manager_backend.h"
#include "content/browser/webui/web_ui_controller_factory_registry.h"
#include "content/browser/webui/web_ui_url_loader_factory.h"
#include "content/common/accessibility_messages.h"
@@ -3050,14 +3051,15 @@ void RenderFrameHostImpl::CommitNavigation(
commit_data.handle = handle.release();
// TODO(scottmg): Pass a factory for SW, etc. once we have one.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableNetworkService) &&
- common_params.url.SchemeIs(kChromeUIScheme)) {
- commit_data.url_loader_factory = GetWebUIURLLoader(frame_tree_node_)
- .PassInterface()
- .PassHandle()
- .release();
- } else {
- commit_data.url_loader_factory = mojo::MessagePipeHandle();
+ switches::kEnableNetworkService)) {
+ const auto& schemes = URLDataManagerBackend::GetWebUISchemes();
+ if (std::find(schemes.begin(), schemes.end(), common_params.url.scheme()) !=
+ schemes.end()) {
+ commit_data.url_loader_factory = GetWebUIURLLoader(frame_tree_node_)
+ .PassInterface()
+ .PassHandle()
+ .release();
+ }
}
Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, commit_data,
common_params, request_params));
« no previous file with comments | « no previous file | content/browser/loader/navigation_url_loader_network_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698