Skip to content

Commit

Permalink
[Lacros] Enable WebUSB, WebSerial, chrome.usb, chrome.serial API supp…
Browse files Browse the repository at this point in the history
…ort.

This CL enables USB and Serial related API on Lacros, by applying the
broad stroke of switching Lacros to use code that was previously
Ash-only. More work might be needed later to iron out details.

Bug: 1195247, 1195248
Change-Id: I04579cf60ca263907407abdc12cf7a9d5f9d10c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2939830
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: Theodore Olsauskas-Warren <sauski@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893539}
  • Loading branch information
samuelhuang authored and Chromium LUCI CQ committed Jun 17, 2021
1 parent 9803307 commit 97e3106
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 64 deletions.
9 changes: 6 additions & 3 deletions chrome/browser/extensions/api/chrome_extensions_api_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,12 @@ ChromeExtensionsAPIClient::CreateDevicePermissionsPrompt(
return std::make_unique<ChromeDevicePermissionsPrompt>(web_contents);
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
bool ChromeExtensionsAPIClient::ShouldAllowDetachingUsb(int vid,
int pid) const {
// TOOD(huangs): Figure out how to do the following in Lacros, which does not
// have access to ash::CrosSettings (https://crbug.com/1219329).
#if BUILDFLAG(IS_CHROMEOS_ASH)
const base::ListValue* policy_list;
if (ash::CrosSettings::Get()->GetList(chromeos::kUsbDetachableAllowlist,
&policy_list)) {
Expand All @@ -337,10 +340,10 @@ bool ChromeExtensionsAPIClient::ShouldAllowDetachingUsb(int vid,
}
}
}

#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return false;
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

std::unique_ptr<VirtualKeyboardDelegate>
ChromeExtensionsAPIClient::CreateVirtualKeyboardDelegate(
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/extensions/api/chrome_extensions_api_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class ChromeExtensionsAPIClient : public ExtensionsAPIClient {
RulesCacheDelegate* cache_delegate) const override;
std::unique_ptr<DevicePermissionsPrompt> CreateDevicePermissionsPrompt(
content::WebContents* web_contents) const override;
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
bool ShouldAllowDetachingUsb(int vid, int pid) const override;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
std::unique_ptr<VirtualKeyboardDelegate> CreateVirtualKeyboardDelegate(
content::BrowserContext* browser_context) const override;
ManagementAPIDelegate* CreateManagementAPIDelegate() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#include "ui/base/text/bytes_formatting.h"
#include "ui/webui/webui_allowlist.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/ash/login/users/mock_user_manager.h"
#include "components/user_manager/scoped_user_manager.h"
#endif
Expand Down
3 changes: 2 additions & 1 deletion chromeos/dbus/permission_broker/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import("//third_party/protobuf/proto_library.gni")

assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos")
assert(is_chromeos_ash || is_chromeos_lacros,
"Non-Chrome-OS or Lacros builds must not depend on //chromeos")

component("permission_broker") {
defines = [ "IS_PERMISSION_BROKER_IMPL" ]
Expand Down
2 changes: 1 addition & 1 deletion device/gamepad/gamepad_device_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "device/udev_linux/udev.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/permission_broker/permission_broker_client.h"
#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

namespace device {
Expand Down
2 changes: 1 addition & 1 deletion extensions/browser/api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ source_set("api") {
"clipboard/clipboard_api.h",
]
deps += [
"//chromeos/dbus/permission_broker",
"//components/prefs:prefs",
"//ui/base/clipboard",
]
Expand Down Expand Up @@ -103,7 +104,6 @@ source_set("api") {
"//chromeos/dbus",
"//chromeos/dbus/media_analytics",
"//chromeos/dbus/media_analytics:media_perception_proto",
"//chromeos/dbus/permission_broker",
"//chromeos/dbus/upstart",
"//chromeos/login/login_state",
"//chromeos/services/media_perception/public/mojom",
Expand Down
11 changes: 6 additions & 5 deletions extensions/browser/api/device_permissions_prompt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include "services/device/public/mojom/usb_enumeration_options.mojom.h"
#include "ui/base/l10n/l10n_util.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/permission_broker/permission_broker_client.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

using device::HidDeviceFilter;
using device::mojom::UsbDeviceFilterPtr;
Expand Down Expand Up @@ -149,7 +149,7 @@ class UsbDevicePermissionsPrompt : public DevicePermissionsPrompt::Prompt,
remaining_initial_devices_++;

auto device_info = std::make_unique<UsbDeviceInfo>(device.Clone());
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
auto* device_manager = UsbDeviceManager::Get(browser_context());
DCHECK(device_manager);
device_manager->CheckAccess(
Expand All @@ -159,7 +159,7 @@ class UsbDevicePermissionsPrompt : public DevicePermissionsPrompt::Prompt,
#else
AddCheckedDevice(std::move(device_info), initial_enumeration,
/*allowed=*/true);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
}

void AddCheckedDevice(std::unique_ptr<UsbDeviceInfo> device_info,
Expand Down Expand Up @@ -335,6 +335,7 @@ class HidDevicePermissionsPrompt : public DevicePermissionsPrompt::Prompt,
remaining_initial_devices_++;

auto device_info = std::make_unique<HidDeviceInfo>(std::move(device));
// TODO(huangs): Enable this for Lacros (crbug.com/1217124).
#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::PermissionBrokerClient::Get()->CheckPathAccess(
device_info.get()->device()->device_node,
Expand Down
4 changes: 2 additions & 2 deletions extensions/browser/api/extensions_api_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ ExtensionsAPIClient::CreateDevicePermissionsPrompt(
return nullptr;
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
bool ExtensionsAPIClient::ShouldAllowDetachingUsb(int vid, int pid) const {
return false;
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

std::unique_ptr<VirtualKeyboardDelegate>
ExtensionsAPIClient::CreateVirtualKeyboardDelegate(
Expand Down
4 changes: 2 additions & 2 deletions extensions/browser/api/extensions_api_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ class ExtensionsAPIClient {
virtual std::unique_ptr<DevicePermissionsPrompt>
CreateDevicePermissionsPrompt(content::WebContents* web_contents) const;

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Returns true if device policy allows detaching a given USB device.
virtual bool ShouldAllowDetachingUsb(int vid, int pid) const;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

// Returns a delegate for some of VirtualKeyboardAPI's behavior.
virtual std::unique_ptr<VirtualKeyboardDelegate>
Expand Down
8 changes: 4 additions & 4 deletions extensions/browser/api/usb/usb_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ class TestExtensionsAPIClient : public ShellExtensionsAPIClient {
return std::make_unique<TestDevicePermissionsPrompt>(web_contents);
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
bool ShouldAllowDetachingUsb(int vid, int pid) const override {
return vid == 1 && pid == 2;
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
};

class UsbApiTest : public ShellApiTest {
Expand Down Expand Up @@ -365,7 +365,7 @@ IN_PROC_BROWSER_TEST_F(UsbApiTest, GetUserSelectedDevices) {
ASSERT_TRUE(result_listener.WaitUntilSatisfied());
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
IN_PROC_BROWSER_TEST_F(UsbApiTest, MassStorage) {
ExtensionTestMessageListener ready_listener("ready", false);
ready_listener.set_failure_message("failure");
Expand Down Expand Up @@ -397,6 +397,6 @@ IN_PROC_BROWSER_TEST_F(UsbApiTest, MassStorage) {

ASSERT_TRUE(result_listener.WaitUntilSatisfied());
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

} // namespace extensions
8 changes: 4 additions & 4 deletions extensions/browser/api/usb/usb_device_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ bool ShouldExposeDevice(const device::mojom::UsbDeviceInfo& device_info) {
}
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
if (ExtensionsAPIClient::Get()->ShouldAllowDetachingUsb(
device_info.vendor_id, device_info.product_id)) {
return true;
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

return false;
}
Expand Down Expand Up @@ -212,14 +212,14 @@ bool UsbDeviceManager::UpdateActiveConfig(const std::string& guid,
return true;
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
void UsbDeviceManager::CheckAccess(
const std::string& guid,
device::mojom::UsbDeviceManager::CheckAccessCallback callback) {
EnsureConnectionWithDeviceManager();
device_manager_->CheckAccess(guid, std::move(callback));
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void UsbDeviceManager::EnsureConnectionWithDeviceManager() {
if (device_manager_)
Expand Down
4 changes: 2 additions & 2 deletions extensions/browser/api/usb/usb_device_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class UsbDeviceManager : public BrowserContextKeyedAPI,
const device::mojom::UsbDeviceInfo* GetDeviceInfo(const std::string& guid);
bool UpdateActiveConfig(const std::string& guid, uint8_t config_value);

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
void CheckAccess(
const std::string& guid,
device::mojom::UsbDeviceManager::CheckAccessCallback callback);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void EnsureConnectionWithDeviceManager();

Expand Down
4 changes: 3 additions & 1 deletion services/device/hid/hid_service_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
#include "device/udev_linux/udev_watcher.h"
#include "services/device/hid/hid_connection_linux.h"

// TODO(huangs): Enable for IS_CHROMEOS_LACROS. This will simplify crosapi so
// that it won't need to pass HidManager around (crbug.com/1109621).
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/system/sys_info.h"
#include "chromeos/dbus/permission_broker/permission_broker_client.h"
#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

namespace device {
Expand Down
4 changes: 2 additions & 2 deletions services/device/public/cpp/test/fake_usb_device_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void FakeUsbDeviceManager::RefreshDeviceInfo(
}
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
void FakeUsbDeviceManager::CheckAccess(const std::string& guid,
CheckAccessCallback callback) {
std::move(callback).Run(true);
Expand All @@ -99,7 +99,7 @@ void FakeUsbDeviceManager::OpenFileDescriptor(
base::FilePath(FILE_PATH_LITERAL("/dev/null")),
base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE));
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void FakeUsbDeviceManager::SetClient(
mojo::PendingAssociatedRemote<mojom::UsbDeviceManagerClient> client) {
Expand Down
4 changes: 2 additions & 2 deletions services/device/public/cpp/test/fake_usb_device_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ class FakeUsbDeviceManager : public mojom::UsbDeviceManager {
RefreshDeviceInfoCallback callback) override;
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
void CheckAccess(const std::string& guid,
CheckAccessCallback callback) override;

void OpenFileDescriptor(const std::string& guid,
uint32_t drop_privileges_mask,
mojo::PlatformHandle lifeline_fd,
OpenFileDescriptorCallback callback) override;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void SetClient(mojo::PendingAssociatedRemote<mojom::UsbDeviceManagerClient>
client) override;
Expand Down
4 changes: 2 additions & 2 deletions services/device/public/mojom/usb_manager.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ interface UsbDeviceManager {

// Check whether permission_broker will allow a future Open call for
// a given USB device to succeed.
[EnableIf=is_chromeos_ash]
[EnableIf=is_chromeos]
CheckAccess(string guid) => (bool success);

// Attempt to open a USB device using permission_broker and return
// a file descriptor. Allow access only to interfaces specified in
// |allowed_interfaces_mask|. The |lifeline_fd| should be the remote end of
// a pipe created locally, and when this pipe is closed permission_broker
// reattaches any kernel drivers that may have been detached when opening.
[EnableIf=is_chromeos_ash]
[EnableIf=is_chromeos]
OpenFileDescriptor(string guid, uint32 allowed_interfaces_mask,
handle<platform> lifeline_fd)
=> (mojo_base.mojom.File? fd);
Expand Down
14 changes: 7 additions & 7 deletions services/device/serial/serial_io_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "build/chromeos_buildflags.h"
#include "components/device_event_log/device_event_log.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/permission_broker/permission_broker_client.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

namespace device {

Expand Down Expand Up @@ -51,7 +51,7 @@ void SerialIoHandler::Open(const mojom::SerialConnectionOptions& options,
DCHECK(ui_thread_task_runner_.get());
MergeConnectionOptions(options);

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Note: dbus clients are destroyed in PostDestroyThreads so passing |client|
// as unretained is safe.
auto* client = chromeos::PermissionBrokerClient::Get();
Expand All @@ -73,10 +73,10 @@ void SerialIoHandler::Open(const mojom::SerialConnectionOptions& options,
{base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(&SerialIoHandler::StartOpen, this,
base::ThreadTaskRunnerHandle::Get()));
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
}

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void SerialIoHandler::OnPathOpened(
scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
Expand Down Expand Up @@ -105,7 +105,7 @@ void SerialIoHandler::ReportPathOpenError(const std::string& error_name,
std::move(open_complete_).Run(false);
}

#endif
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void SerialIoHandler::MergeConnectionOptions(
const mojom::SerialConnectionOptions& options) {
Expand Down
4 changes: 2 additions & 2 deletions services/device/serial/serial_io_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SerialIoHandler : public base::RefCountedThreadSafe<SerialIoHandler> {
virtual void Open(const mojom::SerialConnectionOptions& options,
OpenCompleteCallback callback);

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Signals that the port has been opened.
void OnPathOpened(
scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
Expand All @@ -59,7 +59,7 @@ class SerialIoHandler : public base::RefCountedThreadSafe<SerialIoHandler> {
// Reports the open error from the permission broker.
void ReportPathOpenError(const std::string& error_name,
const std::string& error_message);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

// Performs an async read operation. Behavior is undefined if this is called
// while a read is already pending. Otherwise, |callback| will eventually be
Expand Down
2 changes: 1 addition & 1 deletion services/device/usb/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static_library("usb") {
]
}

if (is_chromeos_ash) {
if (is_chromeos_ash || is_chromeos_lacros) {
deps += [
"//chromeos/dbus/permission_broker",
"//dbus",
Expand Down
10 changes: 5 additions & 5 deletions services/device/usb/mojo/device_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#include "services/device/usb/usb_device.h"
#include "services/device/usb/usb_service.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/permission_broker/permission_broker_client.h"
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck
#include "services/device/usb/usb_device_linux.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

namespace device {
namespace usb {
Expand Down Expand Up @@ -118,7 +118,7 @@ void DeviceManagerImpl::OnPermissionGrantedToRefresh(
}
#endif // defined(OS_ANDROID)

#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
void DeviceManagerImpl::CheckAccess(const std::string& guid,
CheckAccessCallback callback) {
scoped_refptr<UsbDevice> device = usb_service_->GetDevice(guid);
Expand Down Expand Up @@ -172,7 +172,7 @@ void DeviceManagerImpl::OnOpenFileDescriptorError(
<< message;
std::move(callback).Run(base::File());
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)

void DeviceManagerImpl::SetClient(
mojo::PendingAssociatedRemote<mojom::UsbDeviceManagerClient> client) {
Expand Down
Loading

0 comments on commit 97e3106

Please sign in to comment.