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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #include "content/public/browser/render_process_host.h" | 72 #include "content/public/browser/render_process_host.h" |
73 #include "content/public/browser/render_widget_host_view.h" | 73 #include "content/public/browser/render_widget_host_view.h" |
74 #include "content/public/browser/stream_handle.h" | 74 #include "content/public/browser/stream_handle.h" |
75 #include "content/public/browser/user_metrics.h" | 75 #include "content/public/browser/user_metrics.h" |
76 #include "content/public/common/browser_side_navigation_policy.h" | 76 #include "content/public/common/browser_side_navigation_policy.h" |
77 #include "content/public/common/content_constants.h" | 77 #include "content/public/common/content_constants.h" |
78 #include "content/public/common/content_switches.h" | 78 #include "content/public/common/content_switches.h" |
79 #include "content/public/common/isolated_world_ids.h" | 79 #include "content/public/common/isolated_world_ids.h" |
80 #include "content/public/common/url_constants.h" | 80 #include "content/public/common/url_constants.h" |
81 #include "content/public/common/url_utils.h" | 81 #include "content/public/common/url_utils.h" |
| 82 #include "device/sensors/sensor_service.h" |
82 #include "device/vibration/vibration_manager_impl.h" | 83 #include "device/vibration/vibration_manager_impl.h" |
83 #include "ui/accessibility/ax_tree.h" | 84 #include "ui/accessibility/ax_tree.h" |
84 #include "ui/accessibility/ax_tree_update.h" | 85 #include "ui/accessibility/ax_tree_update.h" |
85 #include "ui/gfx/geometry/quad_f.h" | 86 #include "ui/gfx/geometry/quad_f.h" |
86 #include "url/gurl.h" | 87 #include "url/gurl.h" |
87 | 88 |
88 #if defined(OS_ANDROID) | 89 #if defined(OS_ANDROID) |
89 #include "content/browser/mojo/service_registrar_android.h" | 90 #include "content/browser/mojo/service_registrar_android.h" |
90 #endif | 91 #endif |
91 | 92 |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 | 2023 |
2023 #if defined(ENABLE_WEBVR) | 2024 #if defined(ENABLE_WEBVR) |
2024 const base::CommandLine& browser_command_line = | 2025 const base::CommandLine& browser_command_line = |
2025 *base::CommandLine::ForCurrentProcess(); | 2026 *base::CommandLine::ForCurrentProcess(); |
2026 | 2027 |
2027 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { | 2028 if (browser_command_line.HasSwitch(switches::kEnableWebVR)) { |
2028 GetServiceRegistry()->AddService<blink::mojom::VRService>( | 2029 GetServiceRegistry()->AddService<blink::mojom::VRService>( |
2029 base::Bind(&device::VRDeviceManager::BindRequest)); | 2030 base::Bind(&device::VRDeviceManager::BindRequest)); |
2030 } | 2031 } |
2031 #endif | 2032 #endif |
| 2033 // TODO(Mikhail): Add cmd line switch for sensors. |
| 2034 GetServiceRegistry()->AddService(base::Bind( |
| 2035 &device::SensorService::BindRequest, |
| 2036 base::RetainedRef( |
| 2037 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); |
2032 | 2038 |
2033 GetContentClient()->browser()->RegisterRenderFrameMojoServices( | 2039 GetContentClient()->browser()->RegisterRenderFrameMojoServices( |
2034 GetServiceRegistry(), this); | 2040 GetServiceRegistry(), this); |
2035 } | 2041 } |
2036 | 2042 |
2037 void RenderFrameHostImpl::ResetWaitingState() { | 2043 void RenderFrameHostImpl::ResetWaitingState() { |
2038 DCHECK(is_active()); | 2044 DCHECK(is_active()); |
2039 | 2045 |
2040 // The active state of the RVH is determined by its main frame, since | 2046 // The active state of the RVH is determined by its main frame, since |
2041 // subframes should have their own widgets. | 2047 // subframes should have their own widgets. |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2864 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
2859 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2865 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
2860 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2866 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
2861 } | 2867 } |
2862 | 2868 |
2863 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2869 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
2864 web_bluetooth_service_.reset(); | 2870 web_bluetooth_service_.reset(); |
2865 } | 2871 } |
2866 | 2872 |
2867 } // namespace content | 2873 } // namespace content |
OLD | NEW |