Commit 7885d19f authored by Francois Beaufort's avatar Francois Beaufort Committed by Chromium LUCI CQ

[WebNFC] Remove services/device code on Desktop build

This CL removes services/device code of the Web NFC API to reduce binary
size of the Desktop build.

Bug: 520391
Change-Id: I63cd742e8a185acd755354664d27348fd5bf17c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595421Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#840991}
parent 1d4b07c3
......@@ -223,15 +223,12 @@ void DeviceService::BindBatteryMonitor(
#endif
}
#if defined(OS_ANDROID)
void DeviceService::BindNFCProvider(
mojo::PendingReceiver<mojom::NFCProvider> receiver) {
#if defined(OS_ANDROID)
GetJavaInterfaceProvider()->GetInterface(std::move(receiver));
#else
LOG(ERROR) << "NFC is only supported on Android";
NOTREACHED();
#endif
}
#endif
void DeviceService::BindVibrationManager(
mojo::PendingReceiver<mojom::VibrationManager> receiver) {
......
......@@ -24,7 +24,6 @@
#include "services/device/public/mojom/geolocation_config.mojom.h"
#include "services/device/public/mojom/geolocation_context.mojom.h"
#include "services/device/public/mojom/geolocation_control.mojom.h"
#include "services/device/public/mojom/nfc_provider.mojom.h"
#include "services/device/public/mojom/power_monitor.mojom.h"
#include "services/device/public/mojom/screen_orientation.mojom.h"
#include "services/device/public/mojom/sensor_provider.mojom.h"
......@@ -42,6 +41,7 @@
#if defined(OS_ANDROID)
#include "base/android/scoped_java_ref.h"
#include "services/device/public/mojom/nfc_provider.mojom.h"
#else
#include "services/device/public/mojom/hid.mojom.h"
#endif
......@@ -156,8 +156,12 @@ class DeviceService : public mojom::DeviceService {
void BindBatteryMonitor(
mojo::PendingReceiver<mojom::BatteryMonitor> receiver) override;
#if defined(OS_ANDROID)
void BindNFCProvider(
mojo::PendingReceiver<mojom::NFCProvider> receiver) override;
#endif
void BindVibrationManager(
mojo::PendingReceiver<mojom::VibrationManager> receiver) override;
......
......@@ -10,7 +10,6 @@ import "services/device/public/mojom/battery_monitor.mojom";
import "services/device/public/mojom/geolocation_config.mojom";
import "services/device/public/mojom/geolocation_context.mojom";
import "services/device/public/mojom/geolocation_control.mojom";
import "services/device/public/mojom/nfc_provider.mojom";
import "services/device/public/mojom/power_monitor.mojom";
import "services/device/public/mojom/public_ip_address_geolocation_provider.mojom";
import "services/device/public/mojom/screen_orientation.mojom";
......@@ -22,6 +21,9 @@ import "services/device/public/mojom/usb_manager_test.mojom";
import "services/device/public/mojom/vibration_manager.mojom";
import "services/device/public/mojom/wake_lock_provider.mojom";
[EnableIf=is_android]
import "services/device/public/mojom/nfc_provider.mojom";
[EnableIf=is_chromeos]
import "services/device/public/mojom/bluetooth_system.mojom";
......@@ -57,6 +59,7 @@ interface DeviceService {
BindBatteryMonitor(pending_receiver<BatteryMonitor> receiver);
// Binds a NFCProvider endpoint.
[EnableIf=is_android]
BindNFCProvider(pending_receiver<NFCProvider> receiver);
// Binds a VibrationManager endpoint.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment