OLD | NEW |
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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 // showing, then WebKit will never send a commit and we'll be left spinning. | 1491 // showing, then WebKit will never send a commit and we'll be left spinning. |
1492 // Set the is_swapped_out_ bit to true, so IPC filtering is in effect and | 1492 // Set the is_swapped_out_ bit to true, so IPC filtering is in effect and |
1493 // the navigation to swappedout:// is not announced to the browser side. | 1493 // the navigation to swappedout:// is not announced to the browser side. |
1494 is_swapped_out_ = true; | 1494 is_swapped_out_ = true; |
1495 GURL swappedOutURL(kSwappedOutURL); | 1495 GURL swappedOutURL(kSwappedOutURL); |
1496 WebURLRequest request(swappedOutURL); | 1496 WebURLRequest request(swappedOutURL); |
1497 frame_->loadRequest(request); | 1497 frame_->loadRequest(request); |
1498 } | 1498 } |
1499 | 1499 |
1500 void RenderFrameImpl::BindServiceRegistry( | 1500 void RenderFrameImpl::BindServiceRegistry( |
1501 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 1501 mojo::InterfaceRequest<mojo::InterfaceProvider> services, |
1502 mojo::ServiceProviderPtr exposed_services) { | 1502 mojo::InterfaceProviderPtr exposed_services) { |
1503 service_registry_.Bind(std::move(services)); | 1503 service_registry_.Bind(std::move(services)); |
1504 service_registry_.BindRemoteServiceProvider(std::move(exposed_services)); | 1504 service_registry_.BindRemoteServiceProvider(std::move(exposed_services)); |
1505 } | 1505 } |
1506 | 1506 |
1507 ManifestManager* RenderFrameImpl::manifest_manager() { | 1507 ManifestManager* RenderFrameImpl::manifest_manager() { |
1508 return manifest_manager_; | 1508 return manifest_manager_; |
1509 } | 1509 } |
1510 | 1510 |
1511 void RenderFrameImpl::SetPendingNavigationParams( | 1511 void RenderFrameImpl::SetPendingNavigationParams( |
1512 scoped_ptr<NavigationParams> navigation_params) { | 1512 scoped_ptr<NavigationParams> navigation_params) { |
(...skipping 4486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5999 media_permission_dispatcher_.reset(new MediaPermissionDispatcher( | 5999 media_permission_dispatcher_.reset(new MediaPermissionDispatcher( |
6000 base::Bind(&RenderFrameImpl::ConnectToService<PermissionService>, | 6000 base::Bind(&RenderFrameImpl::ConnectToService<PermissionService>, |
6001 base::Unretained(this)))); | 6001 base::Unretained(this)))); |
6002 } | 6002 } |
6003 return media_permission_dispatcher_.get(); | 6003 return media_permission_dispatcher_.get(); |
6004 } | 6004 } |
6005 | 6005 |
6006 #if defined(ENABLE_MOJO_MEDIA) | 6006 #if defined(ENABLE_MOJO_MEDIA) |
6007 media::interfaces::ServiceFactory* RenderFrameImpl::GetMediaServiceFactory() { | 6007 media::interfaces::ServiceFactory* RenderFrameImpl::GetMediaServiceFactory() { |
6008 if (!media_service_factory_) { | 6008 if (!media_service_factory_) { |
6009 mojo::ServiceProviderPtr service_provider = | 6009 mojo::InterfaceProviderPtr service_provider = |
6010 ConnectToApplication(GURL("mojo:media")); | 6010 ConnectToApplication(GURL("mojo:media")); |
6011 mojo::ConnectToService(service_provider.get(), &media_service_factory_); | 6011 mojo::ConnectToService(service_provider.get(), &media_service_factory_); |
6012 media_service_factory_.set_connection_error_handler( | 6012 media_service_factory_.set_connection_error_handler( |
6013 base::Bind(&RenderFrameImpl::OnMediaServiceFactoryConnectionError, | 6013 base::Bind(&RenderFrameImpl::OnMediaServiceFactoryConnectionError, |
6014 base::Unretained(this))); | 6014 base::Unretained(this))); |
6015 } | 6015 } |
6016 | 6016 |
6017 return media_service_factory_.get(); | 6017 return media_service_factory_.get(); |
6018 } | 6018 } |
6019 | 6019 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6069 base::Unretained(this))); | 6069 base::Unretained(this))); |
6070 } | 6070 } |
6071 } | 6071 } |
6072 | 6072 |
6073 template <typename Interface> | 6073 template <typename Interface> |
6074 void RenderFrameImpl::ConnectToService( | 6074 void RenderFrameImpl::ConnectToService( |
6075 mojo::InterfaceRequest<Interface> request) { | 6075 mojo::InterfaceRequest<Interface> request) { |
6076 GetServiceRegistry()->ConnectToRemoteService(std::move(request)); | 6076 GetServiceRegistry()->ConnectToRemoteService(std::move(request)); |
6077 } | 6077 } |
6078 | 6078 |
6079 mojo::ServiceProviderPtr RenderFrameImpl::ConnectToApplication( | 6079 mojo::InterfaceProviderPtr RenderFrameImpl::ConnectToApplication( |
6080 const GURL& url) { | 6080 const GURL& url) { |
6081 if (!mojo_shell_) | 6081 if (!mojo_shell_) |
6082 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); | 6082 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); |
6083 mojo::ServiceProviderPtr service_provider; | 6083 mojo::InterfaceProviderPtr service_provider; |
6084 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 6084 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
6085 request->url = mojo::String::From(url); | 6085 request->url = mojo::String::From(url); |
6086 mojo::shell::mojom::CapabilityFilterPtr filter( | 6086 mojo::shell::mojom::CapabilityFilterPtr filter( |
6087 mojo::shell::mojom::CapabilityFilter::New()); | 6087 mojo::shell::mojom::CapabilityFilter::New()); |
6088 mojo::Array<mojo::String> all_interfaces; | 6088 mojo::Array<mojo::String> all_interfaces; |
6089 all_interfaces.push_back("*"); | 6089 all_interfaces.push_back("*"); |
6090 filter->filter.insert("*", std::move(all_interfaces)); | 6090 filter->filter.insert("*", std::move(all_interfaces)); |
6091 mojo_shell_->ConnectToApplication( | 6091 mojo_shell_->ConnectToApplication( |
6092 std::move(request), GetProxy(&service_provider), nullptr, | 6092 std::move(request), GetProxy(&service_provider), nullptr, |
6093 std::move(filter), base::Bind(&OnGotRemoteIDs)); | 6093 std::move(filter), base::Bind(&OnGotRemoteIDs)); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6134 int match_count, | 6134 int match_count, |
6135 int ordinal, | 6135 int ordinal, |
6136 const WebRect& selection_rect, | 6136 const WebRect& selection_rect, |
6137 bool final_status_update) { | 6137 bool final_status_update) { |
6138 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6138 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6139 selection_rect, ordinal, | 6139 selection_rect, ordinal, |
6140 final_status_update)); | 6140 final_status_update)); |
6141 } | 6141 } |
6142 | 6142 |
6143 } // namespace content | 6143 } // namespace content |
OLD | NEW |