Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 #include "content/public/browser/user_metrics.h" | 76 #include "content/public/browser/user_metrics.h" |
| 77 #include "content/public/common/browser_side_navigation_policy.h" | 77 #include "content/public/common/browser_side_navigation_policy.h" |
| 78 #include "content/public/common/content_constants.h" | 78 #include "content/public/common/content_constants.h" |
| 79 #include "content/public/common/content_switches.h" | 79 #include "content/public/common/content_switches.h" |
| 80 #include "content/public/common/file_chooser_file_info.h" | 80 #include "content/public/common/file_chooser_file_info.h" |
| 81 #include "content/public/common/file_chooser_params.h" | 81 #include "content/public/common/file_chooser_params.h" |
| 82 #include "content/public/common/isolated_world_ids.h" | 82 #include "content/public/common/isolated_world_ids.h" |
| 83 #include "content/public/common/url_constants.h" | 83 #include "content/public/common/url_constants.h" |
| 84 #include "content/public/common/url_utils.h" | 84 #include "content/public/common/url_utils.h" |
| 85 #include "device/vibration/vibration_manager_impl.h" | 85 #include "device/vibration/vibration_manager_impl.h" |
| 86 // TODO(tguilbert): For reviewers: Is it ok to about include \\media files in | |
| 87 // this file? | |
| 88 #include "media/media_features.h" | |
|
xhwang
2016/06/22 17:39:02
this is fine. content/ already depends on media/
| |
| 86 #include "ui/accessibility/ax_tree.h" | 89 #include "ui/accessibility/ax_tree.h" |
| 87 #include "ui/accessibility/ax_tree_update.h" | 90 #include "ui/accessibility/ax_tree_update.h" |
| 88 #include "ui/gfx/geometry/quad_f.h" | 91 #include "ui/gfx/geometry/quad_f.h" |
| 89 #include "url/gurl.h" | 92 #include "url/gurl.h" |
| 90 | 93 |
| 91 #if defined(OS_ANDROID) | 94 #if defined(OS_ANDROID) |
| 92 #include "content/browser/mojo/service_registrar_android.h" | 95 #include "content/browser/mojo/service_registrar_android.h" |
| 93 #endif | 96 #endif |
| 94 | 97 |
| 98 #if BUILDFLAG(FORCE_MOJO_MEDIA_PLAYER_RENDERER) | |
| 99 #include "media/mojo/services/mojo_media_player_renderer_helper.h" | |
| 100 #endif | |
| 101 | |
| 95 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
| 96 #include "content/browser/frame_host/popup_menu_helper_mac.h" | 103 #include "content/browser/frame_host/popup_menu_helper_mac.h" |
| 97 #endif | 104 #endif |
| 98 | 105 |
| 99 #if defined(ENABLE_WEBVR) | 106 #if defined(ENABLE_WEBVR) |
| 100 #include "base/command_line.h" | 107 #include "base/command_line.h" |
| 101 #include "content/public/common/content_switches.h" | 108 #include "content/public/common/content_switches.h" |
| 102 #include "device/vr/vr_device_manager.h" // nogncheck | 109 #include "device/vr/vr_device_manager.h" // nogncheck |
| 103 #endif | 110 #endif |
| 104 | 111 |
| (...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2044 #if defined(ENABLE_WEBVR) | 2051 #if defined(ENABLE_WEBVR) |
| 2045 const base::CommandLine& browser_command_line = | 2052 const base::CommandLine& browser_command_line = |
| 2046 *base::CommandLine::ForCurrentProcess(); | 2053 *base::CommandLine::ForCurrentProcess(); |
| 2047 | 2054 |
| 2048 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { | 2055 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { |
| 2049 GetServiceRegistry()->AddService<device::VRService>( | 2056 GetServiceRegistry()->AddService<device::VRService>( |
| 2050 base::Bind(&device::VRDeviceManager::BindRequest)); | 2057 base::Bind(&device::VRDeviceManager::BindRequest)); |
| 2051 } | 2058 } |
| 2052 #endif | 2059 #endif |
| 2053 | 2060 |
| 2061 #if BUILDFLAG(FORCE_MOJO_MEDIA_PLAYER_RENDERER) | |
| 2062 // This service creates a MojoRendererService, passing it a MediaPlayerRender. | |
| 2063 // TODO(tguilbert): For reviewers: is there a need for disambiguating the | |
| 2064 // mojom::Renderer service at a RenderFrameHost level? | |
| 2065 GetServiceRegistry()->AddService<media::mojom::Renderer>(base::Bind( | |
| 2066 &media::MojoMediaPlayerRendererHelper::CreateMediaPlayerRenderer, | |
|
xhwang
2016/06/22 17:39:02
You don't really need a class to do this. You can
| |
| 2067 base::Unretained(this))); | |
| 2068 #endif | |
| 2069 | |
| 2054 GetContentClient()->browser()->RegisterRenderFrameMojoServices( | 2070 GetContentClient()->browser()->RegisterRenderFrameMojoServices( |
| 2055 GetServiceRegistry(), this); | 2071 GetServiceRegistry(), this); |
| 2056 } | 2072 } |
| 2057 | 2073 |
| 2058 void RenderFrameHostImpl::ResetWaitingState() { | 2074 void RenderFrameHostImpl::ResetWaitingState() { |
| 2059 DCHECK(is_active()); | 2075 DCHECK(is_active()); |
| 2060 | 2076 |
| 2061 // The active state of the RVH is determined by its main frame, since | 2077 // The active state of the RVH is determined by its main frame, since |
| 2062 // subframes should have their own widgets. | 2078 // subframes should have their own widgets. |
| 2063 if (frame_tree_node_->IsMainFrame()) { | 2079 if (frame_tree_node_->IsMainFrame()) { |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2906 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2922 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
| 2907 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2923 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 2908 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2924 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 2909 } | 2925 } |
| 2910 | 2926 |
| 2911 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2927 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 2912 web_bluetooth_service_.reset(); | 2928 web_bluetooth_service_.reset(); |
| 2913 } | 2929 } |
| 2914 | 2930 |
| 2915 } // namespace content | 2931 } // namespace content |
| OLD | NEW |