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 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 // showing, then WebKit will never send a commit and we'll be left spinning. | 1464 // showing, then WebKit will never send a commit and we'll be left spinning. |
1465 // Set the is_swapped_out_ bit to true, so IPC filtering is in effect and | 1465 // Set the is_swapped_out_ bit to true, so IPC filtering is in effect and |
1466 // the navigation to swappedout:// is not announced to the browser side. | 1466 // the navigation to swappedout:// is not announced to the browser side. |
1467 is_swapped_out_ = true; | 1467 is_swapped_out_ = true; |
1468 GURL swappedOutURL(kSwappedOutURL); | 1468 GURL swappedOutURL(kSwappedOutURL); |
1469 WebURLRequest request(swappedOutURL); | 1469 WebURLRequest request(swappedOutURL); |
1470 frame_->loadRequest(request); | 1470 frame_->loadRequest(request); |
1471 } | 1471 } |
1472 | 1472 |
1473 void RenderFrameImpl::BindServiceRegistry( | 1473 void RenderFrameImpl::BindServiceRegistry( |
1474 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 1474 mojo::InterfaceRequest<mojo::InterfaceProvider> services, |
1475 mojo::ServiceProviderPtr exposed_services) { | 1475 mojo::InterfaceProviderPtr exposed_services) { |
1476 service_registry_.Bind(std::move(services)); | 1476 service_registry_.Bind(std::move(services)); |
1477 service_registry_.BindRemoteServiceProvider(std::move(exposed_services)); | 1477 service_registry_.BindRemoteServiceProvider(std::move(exposed_services)); |
1478 } | 1478 } |
1479 | 1479 |
1480 ManifestManager* RenderFrameImpl::manifest_manager() { | 1480 ManifestManager* RenderFrameImpl::manifest_manager() { |
1481 return manifest_manager_; | 1481 return manifest_manager_; |
1482 } | 1482 } |
1483 | 1483 |
1484 void RenderFrameImpl::SetPendingNavigationParams( | 1484 void RenderFrameImpl::SetPendingNavigationParams( |
1485 scoped_ptr<NavigationParams> navigation_params) { | 1485 scoped_ptr<NavigationParams> navigation_params) { |
(...skipping 4482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5968 media_permission_dispatcher_.reset(new MediaPermissionDispatcher( | 5968 media_permission_dispatcher_.reset(new MediaPermissionDispatcher( |
5969 base::Bind(&RenderFrameImpl::ConnectToService<PermissionService>, | 5969 base::Bind(&RenderFrameImpl::ConnectToService<PermissionService>, |
5970 base::Unretained(this)))); | 5970 base::Unretained(this)))); |
5971 } | 5971 } |
5972 return media_permission_dispatcher_.get(); | 5972 return media_permission_dispatcher_.get(); |
5973 } | 5973 } |
5974 | 5974 |
5975 #if defined(ENABLE_MOJO_MEDIA) | 5975 #if defined(ENABLE_MOJO_MEDIA) |
5976 media::interfaces::ServiceFactory* RenderFrameImpl::GetMediaServiceFactory() { | 5976 media::interfaces::ServiceFactory* RenderFrameImpl::GetMediaServiceFactory() { |
5977 if (!media_service_factory_) { | 5977 if (!media_service_factory_) { |
5978 mojo::ServiceProviderPtr service_provider = | 5978 mojo::InterfaceProviderPtr service_provider = |
5979 ConnectToApplication(GURL("mojo:media")); | 5979 ConnectToApplication(GURL("mojo:media")); |
5980 mojo::ConnectToService(service_provider.get(), &media_service_factory_); | 5980 mojo::ConnectToService(service_provider.get(), &media_service_factory_); |
5981 media_service_factory_.set_connection_error_handler( | 5981 media_service_factory_.set_connection_error_handler( |
5982 base::Bind(&RenderFrameImpl::OnMediaServiceFactoryConnectionError, | 5982 base::Bind(&RenderFrameImpl::OnMediaServiceFactoryConnectionError, |
5983 base::Unretained(this))); | 5983 base::Unretained(this))); |
5984 } | 5984 } |
5985 | 5985 |
5986 return media_service_factory_.get(); | 5986 return media_service_factory_.get(); |
5987 } | 5987 } |
5988 | 5988 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6038 base::Unretained(this))); | 6038 base::Unretained(this))); |
6039 } | 6039 } |
6040 } | 6040 } |
6041 | 6041 |
6042 template <typename Interface> | 6042 template <typename Interface> |
6043 void RenderFrameImpl::ConnectToService( | 6043 void RenderFrameImpl::ConnectToService( |
6044 mojo::InterfaceRequest<Interface> request) { | 6044 mojo::InterfaceRequest<Interface> request) { |
6045 GetServiceRegistry()->ConnectToRemoteService(std::move(request)); | 6045 GetServiceRegistry()->ConnectToRemoteService(std::move(request)); |
6046 } | 6046 } |
6047 | 6047 |
6048 mojo::ServiceProviderPtr RenderFrameImpl::ConnectToApplication( | 6048 mojo::InterfaceProviderPtr RenderFrameImpl::ConnectToApplication( |
6049 const GURL& url) { | 6049 const GURL& url) { |
6050 if (!mojo_shell_) | 6050 if (!mojo_shell_) |
6051 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); | 6051 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); |
6052 mojo::ServiceProviderPtr service_provider; | 6052 mojo::InterfaceProviderPtr service_provider; |
6053 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 6053 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
6054 request->url = mojo::String::From(url); | 6054 request->url = mojo::String::From(url); |
6055 mojo::shell::mojom::CapabilityFilterPtr filter( | 6055 mojo::shell::mojom::CapabilityFilterPtr filter( |
6056 mojo::shell::mojom::CapabilityFilter::New()); | 6056 mojo::shell::mojom::CapabilityFilter::New()); |
6057 mojo::Array<mojo::String> all_interfaces; | 6057 mojo::Array<mojo::String> all_interfaces; |
6058 all_interfaces.push_back("*"); | 6058 all_interfaces.push_back("*"); |
6059 filter->filter.insert("*", std::move(all_interfaces)); | 6059 filter->filter.insert("*", std::move(all_interfaces)); |
6060 mojo_shell_->ConnectToApplication( | 6060 mojo_shell_->ConnectToApplication( |
6061 std::move(request), GetProxy(&service_provider), nullptr, | 6061 std::move(request), GetProxy(&service_provider), nullptr, |
6062 std::move(filter), base::Bind(&OnGotRemoteIDs)); | 6062 std::move(filter), base::Bind(&OnGotRemoteIDs)); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6103 int match_count, | 6103 int match_count, |
6104 int ordinal, | 6104 int ordinal, |
6105 const WebRect& selection_rect, | 6105 const WebRect& selection_rect, |
6106 bool final_status_update) { | 6106 bool final_status_update) { |
6107 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6107 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6108 selection_rect, ordinal, | 6108 selection_rect, ordinal, |
6109 final_status_update)); | 6109 final_status_update)); |
6110 } | 6110 } |
6111 | 6111 |
6112 } // namespace content | 6112 } // namespace content |
OLD | NEW |