| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 base::Unretained(permission_service_context_.get()))); | 1539 base::Unretained(permission_service_context_.get()))); |
| 1540 | 1540 |
| 1541 GetServiceRegistry()->AddService<presentation::PresentationService>( | 1541 GetServiceRegistry()->AddService<presentation::PresentationService>( |
| 1542 base::Bind(&PresentationServiceImpl::CreateMojoService, | 1542 base::Bind(&PresentationServiceImpl::CreateMojoService, |
| 1543 base::Unretained(this))); | 1543 base::Unretained(this))); |
| 1544 | 1544 |
| 1545 #if defined(ENABLE_MEDIA_MOJO_RENDERER) | 1545 #if defined(ENABLE_MEDIA_MOJO_RENDERER) |
| 1546 GetServiceRegistry()->AddService<mojo::MediaRenderer>( | 1546 GetServiceRegistry()->AddService<mojo::MediaRenderer>( |
| 1547 base::Bind(&CreateMediaRendererService)); | 1547 base::Bind(&CreateMediaRendererService)); |
| 1548 #endif | 1548 #endif |
| 1549 |
| 1550 GetContentClient()->browser()->OverrideRenderFrameMojoServices( |
| 1551 GetServiceRegistry(), this); |
| 1549 } | 1552 } |
| 1550 | 1553 |
| 1551 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { | 1554 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { |
| 1552 // Only main frames should be swapped out and retained inside a proxy host. | 1555 // Only main frames should be swapped out and retained inside a proxy host. |
| 1553 if (rfh_state == STATE_SWAPPED_OUT) | 1556 if (rfh_state == STATE_SWAPPED_OUT) |
| 1554 CHECK(!GetParent()); | 1557 CHECK(!GetParent()); |
| 1555 | 1558 |
| 1556 // We update the number of RenderFrameHosts in a SiteInstance when the swapped | 1559 // We update the number of RenderFrameHosts in a SiteInstance when the swapped |
| 1557 // out status of a RenderFrameHost gets flipped to/from active. | 1560 // out status of a RenderFrameHost gets flipped to/from active. |
| 1558 if (!IsRFHStateActive(rfh_state_) && IsRFHStateActive(rfh_state)) | 1561 if (!IsRFHStateActive(rfh_state_) && IsRFHStateActive(rfh_state)) |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 return; | 2069 return; |
| 2067 | 2070 |
| 2068 permission_manager->RegisterPermissionUsage( | 2071 permission_manager->RegisterPermissionUsage( |
| 2069 PermissionType::GEOLOCATION, | 2072 PermissionType::GEOLOCATION, |
| 2070 GetLastCommittedURL().GetOrigin(), | 2073 GetLastCommittedURL().GetOrigin(), |
| 2071 frame_tree_node()->frame_tree()->GetMainFrame() | 2074 frame_tree_node()->frame_tree()->GetMainFrame() |
| 2072 ->GetLastCommittedURL().GetOrigin()); | 2075 ->GetLastCommittedURL().GetOrigin()); |
| 2073 } | 2076 } |
| 2074 | 2077 |
| 2075 } // namespace content | 2078 } // namespace content |
| OLD | NEW |