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 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 if (!permission_service_context_) | 1889 if (!permission_service_context_) |
1890 permission_service_context_.reset(new PermissionServiceContext(this)); | 1890 permission_service_context_.reset(new PermissionServiceContext(this)); |
1891 | 1891 |
1892 GetServiceRegistry()->AddService( | 1892 GetServiceRegistry()->AddService( |
1893 base::Bind(&PermissionServiceContext::CreateService, | 1893 base::Bind(&PermissionServiceContext::CreateService, |
1894 base::Unretained(permission_service_context_.get()))); | 1894 base::Unretained(permission_service_context_.get()))); |
1895 | 1895 |
1896 GetServiceRegistry()->AddService(base::Bind( | 1896 GetServiceRegistry()->AddService(base::Bind( |
1897 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); | 1897 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); |
1898 | 1898 |
1899 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1899 bool enable_web_bluetooth = base::CommandLine::ForCurrentProcess()->HasSwitch( |
1900 switches::kEnableWebBluetooth)) { | 1900 switches::kEnableWebBluetooth); |
| 1901 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
| 1902 enable_web_bluetooth = true; |
| 1903 #endif |
| 1904 |
| 1905 if (enable_web_bluetooth) { |
1901 GetServiceRegistry()->AddService( | 1906 GetServiceRegistry()->AddService( |
1902 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, | 1907 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, |
1903 base::Unretained(this))); | 1908 base::Unretained(this))); |
1904 } | 1909 } |
1905 | 1910 |
1906 if (!frame_mojo_shell_) | 1911 if (!frame_mojo_shell_) |
1907 frame_mojo_shell_.reset(new FrameMojoShell(this)); | 1912 frame_mojo_shell_.reset(new FrameMojoShell(this)); |
1908 | 1913 |
1909 GetServiceRegistry()->AddService<mojo::shell::mojom::Connector>(base::Bind( | 1914 GetServiceRegistry()->AddService<mojo::shell::mojom::Connector>(base::Bind( |
1910 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get()))); | 1915 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get()))); |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 } | 2749 } |
2745 | 2750 |
2746 void RenderFrameHostImpl::CreateWebBluetoothService( | 2751 void RenderFrameHostImpl::CreateWebBluetoothService( |
2747 blink::mojom::WebBluetoothServiceRequest request) { | 2752 blink::mojom::WebBluetoothServiceRequest request) { |
2748 DCHECK(!web_bluetooth_service_); | 2753 DCHECK(!web_bluetooth_service_); |
2749 web_bluetooth_service_.reset( | 2754 web_bluetooth_service_.reset( |
2750 new WebBluetoothServiceImpl(this, std::move(request))); | 2755 new WebBluetoothServiceImpl(this, std::move(request))); |
2751 } | 2756 } |
2752 | 2757 |
2753 } // namespace content | 2758 } // namespace content |
OLD | NEW |