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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/mojo_shell_connection.h" | 81 #include "content/public/common/mojo_shell_connection.h" |
82 #include "content/public/common/url_constants.h" | 82 #include "content/public/common/url_constants.h" |
83 #include "content/public/common/url_utils.h" | 83 #include "content/public/common/url_utils.h" |
| 84 #include "device/generic_sensor/sensor_provider_impl.h" |
84 #include "device/geolocation/geolocation_service_context.h" | 85 #include "device/geolocation/geolocation_service_context.h" |
85 #include "device/vibration/vibration_manager_impl.h" | 86 #include "device/vibration/vibration_manager_impl.h" |
86 #include "media/mojo/interfaces/media_service.mojom.h" | 87 #include "media/mojo/interfaces/media_service.mojom.h" |
87 #include "media/mojo/interfaces/service_factory.mojom.h" | 88 #include "media/mojo/interfaces/service_factory.mojom.h" |
88 #include "services/shell/public/cpp/connector.h" | 89 #include "services/shell/public/cpp/connector.h" |
89 #include "services/shell/public/cpp/interface_provider.h" | 90 #include "services/shell/public/cpp/interface_provider.h" |
90 #include "ui/accessibility/ax_tree.h" | 91 #include "ui/accessibility/ax_tree.h" |
91 #include "ui/accessibility/ax_tree_update.h" | 92 #include "ui/accessibility/ax_tree_update.h" |
92 #include "ui/gfx/geometry/quad_f.h" | 93 #include "ui/gfx/geometry/quad_f.h" |
93 #include "url/gurl.h" | 94 #include "url/gurl.h" |
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 | 2143 |
2143 #if defined(ENABLE_WEBVR) | 2144 #if defined(ENABLE_WEBVR) |
2144 const base::CommandLine& browser_command_line = | 2145 const base::CommandLine& browser_command_line = |
2145 *base::CommandLine::ForCurrentProcess(); | 2146 *base::CommandLine::ForCurrentProcess(); |
2146 | 2147 |
2147 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { | 2148 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { |
2148 GetInterfaceRegistry()->AddInterface<device::VRService>( | 2149 GetInterfaceRegistry()->AddInterface<device::VRService>( |
2149 base::Bind(&device::VRServiceImpl::BindRequest)); | 2150 base::Bind(&device::VRServiceImpl::BindRequest)); |
2150 } | 2151 } |
2151 #endif | 2152 #endif |
| 2153 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2154 switches::kEnableGenericSensors)) { |
| 2155 GetInterfaceRegistry()->AddInterface( |
| 2156 base::Bind(&device::SensorProviderImpl::Create), |
| 2157 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 2158 } |
2152 | 2159 |
2153 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( | 2160 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( |
2154 GetInterfaceRegistry(), this); | 2161 GetInterfaceRegistry(), this); |
2155 } | 2162 } |
2156 | 2163 |
2157 void RenderFrameHostImpl::ResetWaitingState() { | 2164 void RenderFrameHostImpl::ResetWaitingState() { |
2158 DCHECK(is_active()); | 2165 DCHECK(is_active()); |
2159 | 2166 |
2160 // Whenever we reset the RFH state, we should not be waiting for beforeunload | 2167 // Whenever we reset the RFH state, we should not be waiting for beforeunload |
2161 // or close acks. We clear them here to be safe, since they can cause | 2168 // or close acks. We clear them here to be safe, since they can cause |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3053 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3047 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3054 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3048 return web_bluetooth_service_.get(); | 3055 return web_bluetooth_service_.get(); |
3049 } | 3056 } |
3050 | 3057 |
3051 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3058 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3052 web_bluetooth_service_.reset(); | 3059 web_bluetooth_service_.reset(); |
3053 } | 3060 } |
3054 | 3061 |
3055 } // namespace content | 3062 } // namespace content |
OLD | NEW |