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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 #include "content/public/browser/stream_handle.h" | 73 #include "content/public/browser/stream_handle.h" |
74 #include "content/public/browser/user_metrics.h" | 74 #include "content/public/browser/user_metrics.h" |
75 #include "content/public/common/browser_side_navigation_policy.h" | 75 #include "content/public/common/browser_side_navigation_policy.h" |
76 #include "content/public/common/content_constants.h" | 76 #include "content/public/common/content_constants.h" |
77 #include "content/public/common/content_switches.h" | 77 #include "content/public/common/content_switches.h" |
78 #include "content/public/common/file_chooser_file_info.h" | 78 #include "content/public/common/file_chooser_file_info.h" |
79 #include "content/public/common/file_chooser_params.h" | 79 #include "content/public/common/file_chooser_params.h" |
80 #include "content/public/common/isolated_world_ids.h" | 80 #include "content/public/common/isolated_world_ids.h" |
81 #include "content/public/common/url_constants.h" | 81 #include "content/public/common/url_constants.h" |
82 #include "content/public/common/url_utils.h" | 82 #include "content/public/common/url_utils.h" |
83 #include "device/generic_sensor/sensor_service.h" | |
83 #include "device/geolocation/geolocation_service_context.h" | 84 #include "device/geolocation/geolocation_service_context.h" |
84 #include "device/vibration/vibration_manager_impl.h" | 85 #include "device/vibration/vibration_manager_impl.h" |
85 #include "media/mojo/interfaces/media_service.mojom.h" | 86 #include "media/mojo/interfaces/media_service.mojom.h" |
86 #include "media/mojo/interfaces/service_factory.mojom.h" | 87 #include "media/mojo/interfaces/service_factory.mojom.h" |
87 #include "services/shell/public/cpp/connector.h" | 88 #include "services/shell/public/cpp/connector.h" |
88 #include "services/shell/public/cpp/interface_provider.h" | 89 #include "services/shell/public/cpp/interface_provider.h" |
89 #include "ui/accessibility/ax_tree.h" | 90 #include "ui/accessibility/ax_tree.h" |
90 #include "ui/accessibility/ax_tree_update.h" | 91 #include "ui/accessibility/ax_tree_update.h" |
91 #include "ui/gfx/geometry/quad_f.h" | 92 #include "ui/gfx/geometry/quad_f.h" |
92 #include "url/gurl.h" | 93 #include "url/gurl.h" |
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2134 | 2135 |
2135 #if defined(ENABLE_WEBVR) | 2136 #if defined(ENABLE_WEBVR) |
2136 const base::CommandLine& browser_command_line = | 2137 const base::CommandLine& browser_command_line = |
2137 *base::CommandLine::ForCurrentProcess(); | 2138 *base::CommandLine::ForCurrentProcess(); |
2138 | 2139 |
2139 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { | 2140 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { |
2140 GetInterfaceRegistry()->AddInterface<device::VRService>( | 2141 GetInterfaceRegistry()->AddInterface<device::VRService>( |
2141 base::Bind(&device::VRServiceImpl::BindRequest)); | 2142 base::Bind(&device::VRServiceImpl::BindRequest)); |
2142 } | 2143 } |
2143 #endif | 2144 #endif |
2145 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
2146 switches::kEnableGenericSensors)) { | |
2147 GetInterfaceRegistry()->AddInterface(base::Bind( | |
Ken Rockot(use gerrit already)
2016/08/18 19:36:00
AddInterface() itself can take a task runner as a
Mikhail
2016/08/19 09:29:55
Done.
| |
2148 &device::SensorService::BindRequest, | |
2149 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); | |
2150 } | |
2144 | 2151 |
2145 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( | 2152 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( |
2146 GetInterfaceRegistry(), this); | 2153 GetInterfaceRegistry(), this); |
2147 } | 2154 } |
2148 | 2155 |
2149 void RenderFrameHostImpl::ResetWaitingState() { | 2156 void RenderFrameHostImpl::ResetWaitingState() { |
2150 DCHECK(is_active()); | 2157 DCHECK(is_active()); |
2151 | 2158 |
2152 // The active state of the RVH is determined by its main frame, since | 2159 // The active state of the RVH is determined by its main frame, since |
2153 // subframes should have their own widgets. | 2160 // subframes should have their own widgets. |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3045 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3052 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3046 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3053 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3047 return web_bluetooth_service_.get(); | 3054 return web_bluetooth_service_.get(); |
3048 } | 3055 } |
3049 | 3056 |
3050 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3057 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3051 web_bluetooth_service_.reset(); | 3058 web_bluetooth_service_.reset(); |
3052 } | 3059 } |
3053 | 3060 |
3054 } // namespace content | 3061 } // namespace content |
OLD | NEW |