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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" 51 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h"
52 #include "content/browser/renderer_host/render_process_host_impl.h" 52 #include "content/browser/renderer_host/render_process_host_impl.h"
53 #include "content/browser/renderer_host/render_view_host_delegate.h" 53 #include "content/browser/renderer_host/render_view_host_delegate.h"
54 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 54 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
55 #include "content/browser/renderer_host/render_view_host_impl.h" 55 #include "content/browser/renderer_host/render_view_host_impl.h"
56 #include "content/browser/renderer_host/render_widget_host_delegate.h" 56 #include "content/browser/renderer_host/render_widget_host_delegate.h"
57 #include "content/browser/renderer_host/render_widget_host_impl.h" 57 #include "content/browser/renderer_host/render_widget_host_impl.h"
58 #include "content/browser/renderer_host/render_widget_host_view_base.h" 58 #include "content/browser/renderer_host/render_widget_host_view_base.h"
59 #include "content/browser/shared_worker/shared_worker_service_impl.h" 59 #include "content/browser/shared_worker/shared_worker_service_impl.h"
60 #include "content/browser/websockets/websocket_manager.h" 60 #include "content/browser/websockets/websocket_manager.h"
61 #include "content/browser/webui/url_data_manager_backend.h"
61 #include "content/browser/webui/web_ui_controller_factory_registry.h" 62 #include "content/browser/webui/web_ui_controller_factory_registry.h"
62 #include "content/browser/webui/web_ui_url_loader_factory.h" 63 #include "content/browser/webui/web_ui_url_loader_factory.h"
63 #include "content/common/accessibility_messages.h" 64 #include "content/common/accessibility_messages.h"
64 #include "content/common/associated_interface_provider_impl.h" 65 #include "content/common/associated_interface_provider_impl.h"
65 #include "content/common/associated_interface_registry_impl.h" 66 #include "content/common/associated_interface_registry_impl.h"
66 #include "content/common/associated_interfaces.mojom.h" 67 #include "content/common/associated_interfaces.mojom.h"
67 #include "content/common/content_security_policy/content_security_policy.h" 68 #include "content/common/content_security_policy/content_security_policy.h"
68 #include "content/common/frame_messages.h" 69 #include "content/common/frame_messages.h"
69 #include "content/common/frame_owner_properties.h" 70 #include "content/common/frame_owner_properties.h"
70 #include "content/common/input_messages.h" 71 #include "content/common/input_messages.h"
(...skipping 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
3043 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); 3044 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_));
3044 } 3045 }
3045 3046
3046 const GURL body_url = body.get() ? body->GetURL() : GURL(); 3047 const GURL body_url = body.get() ? body->GetURL() : GURL();
3047 const ResourceResponseHead head = response ? 3048 const ResourceResponseHead head = response ?
3048 response->head : ResourceResponseHead(); 3049 response->head : ResourceResponseHead();
3049 FrameMsg_CommitDataNetworkService_Params commit_data; 3050 FrameMsg_CommitDataNetworkService_Params commit_data;
3050 commit_data.handle = handle.release(); 3051 commit_data.handle = handle.release();
3051 // TODO(scottmg): Pass a factory for SW, etc. once we have one. 3052 // TODO(scottmg): Pass a factory for SW, etc. once we have one.
3052 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 3053 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
3053 switches::kEnableNetworkService) && 3054 switches::kEnableNetworkService)) {
3054 common_params.url.SchemeIs(kChromeUIScheme)) { 3055 const auto& schemes = URLDataManagerBackend::GetWebUISchemes();
3055 commit_data.url_loader_factory = GetWebUIURLLoader(frame_tree_node_) 3056 if (std::find(schemes.begin(), schemes.end(), common_params.url.scheme()) !=
3056 .PassInterface() 3057 schemes.end()) {
3057 .PassHandle() 3058 commit_data.url_loader_factory = GetWebUIURLLoader(frame_tree_node_)
3058 .release(); 3059 .PassInterface()
3059 } else { 3060 .PassHandle()
3060 commit_data.url_loader_factory = mojo::MessagePipeHandle(); 3061 .release();
3062 }
3061 } 3063 }
3062 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, commit_data, 3064 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, commit_data,
3063 common_params, request_params)); 3065 common_params, request_params));
3064 3066
3065 // If a network request was made, update the Previews state. 3067 // If a network request was made, update the Previews state.
3066 if (ShouldMakeNetworkRequestForURL(common_params.url) && 3068 if (ShouldMakeNetworkRequestForURL(common_params.url) &&
3067 !FrameMsg_Navigate_Type::IsSameDocument(common_params.navigation_type)) { 3069 !FrameMsg_Navigate_Type::IsSameDocument(common_params.navigation_type)) {
3068 last_navigation_previews_state_ = common_params.previews_state; 3070 last_navigation_previews_state_ = common_params.previews_state;
3069 } 3071 }
3070 3072
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
3911 } 3913 }
3912 3914
3913 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 3915 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
3914 const std::string& interface_name, 3916 const std::string& interface_name,
3915 mojo::ScopedMessagePipeHandle pipe) { 3917 mojo::ScopedMessagePipeHandle pipe) {
3916 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 3918 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
3917 } 3919 }
3918 #endif 3920 #endif
3919 3921
3920 } // namespace content 3922 } // namespace content
OLDNEW
« 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