| 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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 ResetLoadingState(); | 804 ResetLoadingState(); |
| 805 | 805 |
| 806 // Any future UpdateState or UpdateTitle messages from this or a recreated | 806 // Any future UpdateState or UpdateTitle messages from this or a recreated |
| 807 // process should be ignored until the next commit. | 807 // process should be ignored until the next commit. |
| 808 set_nav_entry_id(0); | 808 set_nav_entry_id(0); |
| 809 } | 809 } |
| 810 | 810 |
| 811 void RenderFrameHostImpl::Create( | 811 void RenderFrameHostImpl::Create( |
| 812 const service_manager::Identity& remote_identity, | 812 const service_manager::Identity& remote_identity, |
| 813 media::mojom::InterfaceFactoryRequest request) { | 813 media::mojom::InterfaceFactoryRequest request) { |
| 814 std::unique_ptr<service_manager::InterfaceRegistry> registry( | 814 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>( |
| 815 new service_manager::InterfaceRegistry); | 815 service_manager::Identity(), service_manager::InterfaceProviderSpec()); |
| 816 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_CDM) | 816 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_CDM) |
| 817 registry->AddInterface( | 817 registry->AddInterface( |
| 818 base::Bind(&ProvisionFetcherImpl::Create, this)); | 818 base::Bind(&ProvisionFetcherImpl::Create, this)); |
| 819 #endif | 819 #endif |
| 820 GetContentClient()->browser()->ExposeInterfacesToMediaService(registry.get(), | 820 GetContentClient()->browser()->ExposeInterfacesToMediaService(registry.get(), |
| 821 this); | 821 this); |
| 822 service_manager::mojom::InterfaceProviderPtr interfaces; | 822 service_manager::mojom::InterfaceProviderPtr interfaces; |
| 823 registry->Bind(GetProxy(&interfaces)); | 823 registry->Bind(GetProxy(&interfaces), |
| 824 service_manager::Identity(), |
| 825 service_manager::InterfaceProviderSpec()); |
| 824 media_registries_.push_back(std::move(registry)); | 826 media_registries_.push_back(std::move(registry)); |
| 825 | 827 |
| 826 // TODO(slan): Use the BrowserContext Connector instead. See crbug.com/638950. | 828 // TODO(slan): Use the BrowserContext Connector instead. See crbug.com/638950. |
| 827 media::mojom::MediaServicePtr media_service; | 829 media::mojom::MediaServicePtr media_service; |
| 828 service_manager::Connector* connector = | 830 service_manager::Connector* connector = |
| 829 ServiceManagerConnection::GetForProcess()->GetConnector(); | 831 ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 830 connector->ConnectToInterface("service:media", &media_service); | 832 connector->ConnectToInterface("service:media", &media_service); |
| 831 media_service->CreateInterfaceFactory(std::move(request), | 833 media_service->CreateInterfaceFactory(std::move(request), |
| 832 std::move(interfaces)); | 834 std::move(interfaces)); |
| 833 } | 835 } |
| (...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2573 | 2575 |
| 2574 // An error page is expected to commit, hence why is_loading_ is set to true. | 2576 // An error page is expected to commit, hence why is_loading_ is set to true. |
| 2575 is_loading_ = true; | 2577 is_loading_ = true; |
| 2576 frame_tree_node_->ResetNavigationRequest(true); | 2578 frame_tree_node_->ResetNavigationRequest(true); |
| 2577 } | 2579 } |
| 2578 | 2580 |
| 2579 void RenderFrameHostImpl::SetUpMojoIfNeeded() { | 2581 void RenderFrameHostImpl::SetUpMojoIfNeeded() { |
| 2580 if (interface_registry_.get()) | 2582 if (interface_registry_.get()) |
| 2581 return; | 2583 return; |
| 2582 | 2584 |
| 2583 interface_registry_.reset(new service_manager::InterfaceRegistry); | 2585 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( |
| 2586 service_manager::Identity(), service_manager::InterfaceProviderSpec()); |
| 2584 if (!GetProcess()->GetRemoteInterfaces()) | 2587 if (!GetProcess()->GetRemoteInterfaces()) |
| 2585 return; | 2588 return; |
| 2586 | 2589 |
| 2587 RegisterMojoInterfaces(); | 2590 RegisterMojoInterfaces(); |
| 2588 mojom::FrameFactoryPtr frame_factory; | 2591 mojom::FrameFactoryPtr frame_factory; |
| 2589 GetProcess()->GetRemoteInterfaces()->GetInterface(&frame_factory); | 2592 GetProcess()->GetRemoteInterfaces()->GetInterface(&frame_factory); |
| 2590 frame_factory->CreateFrame(routing_id_, GetProxy(&frame_), | 2593 frame_factory->CreateFrame(routing_id_, GetProxy(&frame_), |
| 2591 frame_host_binding_.CreateInterfacePtrAndBind()); | 2594 frame_host_binding_.CreateInterfacePtrAndBind()); |
| 2592 | 2595 |
| 2593 service_manager::mojom::InterfaceProviderPtr remote_interfaces; | 2596 service_manager::mojom::InterfaceProviderPtr remote_interfaces; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2857 file_system_context->CrackURL(file.file_system_url) | 2860 file_system_context->CrackURL(file.file_system_url) |
| 2858 .mount_filesystem_id()); | 2861 .mount_filesystem_id()); |
| 2859 } | 2862 } |
| 2860 } | 2863 } |
| 2861 | 2864 |
| 2862 Send(new FrameMsg_RunFileChooserResponse(routing_id_, files)); | 2865 Send(new FrameMsg_RunFileChooserResponse(routing_id_, files)); |
| 2863 } | 2866 } |
| 2864 | 2867 |
| 2865 void RenderFrameHostImpl::GetInterfaceProvider( | 2868 void RenderFrameHostImpl::GetInterfaceProvider( |
| 2866 service_manager::mojom::InterfaceProviderRequest interfaces) { | 2869 service_manager::mojom::InterfaceProviderRequest interfaces) { |
| 2867 interface_registry_->Bind(std::move(interfaces)); | 2870 interface_registry_->Bind(std::move(interfaces), |
| 2871 service_manager::Identity(), |
| 2872 service_manager::InterfaceProviderSpec()); |
| 2868 } | 2873 } |
| 2869 | 2874 |
| 2870 #if defined(USE_EXTERNAL_POPUP_MENU) | 2875 #if defined(USE_EXTERNAL_POPUP_MENU) |
| 2871 #if defined(OS_MACOSX) | 2876 #if defined(OS_MACOSX) |
| 2872 | 2877 |
| 2873 void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) { | 2878 void RenderFrameHostImpl::DidSelectPopupMenuItem(int selected_index) { |
| 2874 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, selected_index)); | 2879 Send(new FrameMsg_SelectPopupMenuItem(routing_id_, selected_index)); |
| 2875 } | 2880 } |
| 2876 | 2881 |
| 2877 void RenderFrameHostImpl::DidCancelPopupMenu() { | 2882 void RenderFrameHostImpl::DidCancelPopupMenu() { |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3138 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3143 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3139 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3144 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3140 return web_bluetooth_service_.get(); | 3145 return web_bluetooth_service_.get(); |
| 3141 } | 3146 } |
| 3142 | 3147 |
| 3143 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3148 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3144 web_bluetooth_service_.reset(); | 3149 web_bluetooth_service_.reset(); |
| 3145 } | 3150 } |
| 3146 | 3151 |
| 3147 } // namespace content | 3152 } // namespace content |
| OLD | NEW |