Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1486043002: [webnfc] Implement push method for Android nfc mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@step_6_add_mojo_service_CL
Patch Set: Fixes for review comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 1930 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
1931 enable_web_bluetooth = true; 1931 enable_web_bluetooth = true;
1932 #endif 1932 #endif
1933 1933
1934 if (enable_web_bluetooth) { 1934 if (enable_web_bluetooth) {
1935 GetServiceRegistry()->AddService( 1935 GetServiceRegistry()->AddService(
1936 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService, 1936 base::Bind(&RenderFrameHostImpl::CreateWebBluetoothService,
1937 base::Unretained(this))); 1937 base::Unretained(this)));
1938 } 1938 }
1939 1939
1940 // On android, NFC is implemented as a Java mojo service.
1941 #if !defined(OS_ANDROID)
1940 GetServiceRegistry()->AddService(base::Bind(&device::NFCImpl::Create)); 1942 GetServiceRegistry()->AddService(base::Bind(&device::NFCImpl::Create));
1943 #endif
1941 1944
1942 if (!frame_mojo_shell_) 1945 if (!frame_mojo_shell_)
1943 frame_mojo_shell_.reset(new FrameMojoShell(this)); 1946 frame_mojo_shell_.reset(new FrameMojoShell(this));
1944 1947
1945 GetServiceRegistry()->AddService<shell::mojom::Connector>(base::Bind( 1948 GetServiceRegistry()->AddService<shell::mojom::Connector>(base::Bind(
1946 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get()))); 1949 &FrameMojoShell::BindRequest, base::Unretained(frame_mojo_shell_.get())));
1947 1950
1948 #if defined(ENABLE_WEBVR) 1951 #if defined(ENABLE_WEBVR)
1949 const base::CommandLine& browser_command_line = 1952 const base::CommandLine& browser_command_line =
1950 *base::CommandLine::ForCurrentProcess(); 1953 *base::CommandLine::ForCurrentProcess();
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2777 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2775 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2778 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2776 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2779 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2777 } 2780 }
2778 2781
2779 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2782 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2780 web_bluetooth_service_.reset(); 2783 web_bluetooth_service_.reset();
2781 } 2784 }
2782 2785
2783 } // namespace content 2786 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/content.gyp » ('j') | device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java » ('J')

Powered by Google App Engine
This is Rietveld 408576698