diff --git a/chrome/browser/extensions/api/chrome_extensions_api_client.cc b/chrome/browser/extensions/api/chrome_extensions_api_client.cc index ff81674b20edc7..7e22c3cc313f89 100644 --- a/chrome/browser/extensions/api/chrome_extensions_api_client.cc +++ b/chrome/browser/extensions/api/chrome_extensions_api_client.cc @@ -324,12 +324,9 @@ ChromeExtensionsAPIClient::CreateDevicePermissionsPrompt( return std::make_unique(web_contents); } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) 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)) { @@ -340,10 +337,10 @@ bool ChromeExtensionsAPIClient::ShouldAllowDetachingUsb(int vid, } } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) + return false; } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) std::unique_ptr ChromeExtensionsAPIClient::CreateVirtualKeyboardDelegate( diff --git a/chrome/browser/extensions/api/chrome_extensions_api_client.h b/chrome/browser/extensions/api/chrome_extensions_api_client.h index f9cab008394806..3aecf42019d3ae 100644 --- a/chrome/browser/extensions/api/chrome_extensions_api_client.h +++ b/chrome/browser/extensions/api/chrome_extensions_api_client.h @@ -65,9 +65,9 @@ class ChromeExtensionsAPIClient : public ExtensionsAPIClient { RulesCacheDelegate* cache_delegate) const override; std::unique_ptr CreateDevicePermissionsPrompt( content::WebContents* web_contents) const override; -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) bool ShouldAllowDetachingUsb(int vid, int pid) const override; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) std::unique_ptr CreateVirtualKeyboardDelegate( content::BrowserContext* browser_context) const override; ManagementAPIDelegate* CreateManagementAPIDelegate() const override; diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc index 888a8f4ebd8137..c67757252e3c6c 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc @@ -70,7 +70,7 @@ #include "ui/base/text/bytes_formatting.h" #include "ui/webui/webui_allowlist.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) #include "chrome/browser/ash/login/users/mock_user_manager.h" #include "components/user_manager/scoped_user_manager.h" #endif diff --git a/chromeos/dbus/permission_broker/BUILD.gn b/chromeos/dbus/permission_broker/BUILD.gn index 56756df3462842..9bcda0647e3a6c 100644 --- a/chromeos/dbus/permission_broker/BUILD.gn +++ b/chromeos/dbus/permission_broker/BUILD.gn @@ -4,8 +4,7 @@ import("//third_party/protobuf/proto_library.gni") -assert(is_chromeos_ash || is_chromeos_lacros, - "Non-Chrome-OS or Lacros builds must not depend on //chromeos") +assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos") component("permission_broker") { defines = [ "IS_PERMISSION_BROKER_IMPL" ] diff --git a/device/gamepad/gamepad_device_linux.cc b/device/gamepad/gamepad_device_linux.cc index 8592b4863968b2..891eaf1667a2b0 100644 --- a/device/gamepad/gamepad_device_linux.cc +++ b/device/gamepad/gamepad_device_linux.cc @@ -27,7 +27,7 @@ #include "device/udev_linux/udev.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck +#include "chromeos/dbus/permission_broker/permission_broker_client.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) namespace device { diff --git a/extensions/browser/api/BUILD.gn b/extensions/browser/api/BUILD.gn index 5f5fa931f3ad57..3845583da83a74 100644 --- a/extensions/browser/api/BUILD.gn +++ b/extensions/browser/api/BUILD.gn @@ -72,7 +72,6 @@ source_set("api") { "clipboard/clipboard_api.h", ] deps += [ - "//chromeos/dbus/permission_broker", "//components/prefs:prefs", "//ui/base/clipboard", ] @@ -104,6 +103,7 @@ 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", diff --git a/extensions/browser/api/device_permissions_prompt.cc b/extensions/browser/api/device_permissions_prompt.cc index d546818556d97d..8642c2316a1e0b 100644 --- a/extensions/browser/api/device_permissions_prompt.cc +++ b/extensions/browser/api/device_permissions_prompt.cc @@ -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) || BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "chromeos/dbus/permission_broker/permission_broker_client.h" +#endif // BUILDFLAG(IS_CHROMEOS_ASH) using device::HidDeviceFilter; using device::mojom::UsbDeviceFilterPtr; @@ -149,7 +149,7 @@ class UsbDevicePermissionsPrompt : public DevicePermissionsPrompt::Prompt, remaining_initial_devices_++; auto device_info = std::make_unique(device.Clone()); -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) auto* device_manager = UsbDeviceManager::Get(browser_context()); DCHECK(device_manager); device_manager->CheckAccess( @@ -159,7 +159,7 @@ class UsbDevicePermissionsPrompt : public DevicePermissionsPrompt::Prompt, #else AddCheckedDevice(std::move(device_info), initial_enumeration, /*allowed=*/true); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } void AddCheckedDevice(std::unique_ptr device_info, @@ -335,7 +335,6 @@ class HidDevicePermissionsPrompt : public DevicePermissionsPrompt::Prompt, remaining_initial_devices_++; auto device_info = std::make_unique(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, diff --git a/extensions/browser/api/extensions_api_client.cc b/extensions/browser/api/extensions_api_client.cc index 11286a449ac02a..49cc8e6b9ab25c 100644 --- a/extensions/browser/api/extensions_api_client.cc +++ b/extensions/browser/api/extensions_api_client.cc @@ -110,11 +110,11 @@ ExtensionsAPIClient::CreateDevicePermissionsPrompt( return nullptr; } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) bool ExtensionsAPIClient::ShouldAllowDetachingUsb(int vid, int pid) const { return false; } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) std::unique_ptr ExtensionsAPIClient::CreateVirtualKeyboardDelegate( diff --git a/extensions/browser/api/extensions_api_client.h b/extensions/browser/api/extensions_api_client.h index 441e5b7373cacd..5fcca481bf6a2b 100644 --- a/extensions/browser/api/extensions_api_client.h +++ b/extensions/browser/api/extensions_api_client.h @@ -161,10 +161,10 @@ class ExtensionsAPIClient { virtual std::unique_ptr CreateDevicePermissionsPrompt(content::WebContents* web_contents) const; -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) // Returns true if device policy allows detaching a given USB device. virtual bool ShouldAllowDetachingUsb(int vid, int pid) const; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) // Returns a delegate for some of VirtualKeyboardAPI's behavior. virtual std::unique_ptr diff --git a/extensions/browser/api/usb/usb_apitest.cc b/extensions/browser/api/usb/usb_apitest.cc index 436d0e7d9873c8..6290db8e296b73 100644 --- a/extensions/browser/api/usb/usb_apitest.cc +++ b/extensions/browser/api/usb/usb_apitest.cc @@ -114,11 +114,11 @@ class TestExtensionsAPIClient : public ShellExtensionsAPIClient { return std::make_unique(web_contents); } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) bool ShouldAllowDetachingUsb(int vid, int pid) const override { return vid == 1 && pid == 2; } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) }; class UsbApiTest : public ShellApiTest { @@ -365,7 +365,7 @@ IN_PROC_BROWSER_TEST_F(UsbApiTest, GetUserSelectedDevices) { ASSERT_TRUE(result_listener.WaitUntilSatisfied()); } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) IN_PROC_BROWSER_TEST_F(UsbApiTest, MassStorage) { ExtensionTestMessageListener ready_listener("ready", false); ready_listener.set_failure_message("failure"); @@ -397,6 +397,6 @@ IN_PROC_BROWSER_TEST_F(UsbApiTest, MassStorage) { ASSERT_TRUE(result_listener.WaitUntilSatisfied()); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } // namespace extensions diff --git a/extensions/browser/api/usb/usb_device_manager.cc b/extensions/browser/api/usb/usb_device_manager.cc index 31c4c0aaf06c94..a0b7ccdcf4148e 100644 --- a/extensions/browser/api/usb/usb_device_manager.cc +++ b/extensions/browser/api/usb/usb_device_manager.cc @@ -52,12 +52,12 @@ bool ShouldExposeDevice(const device::mojom::UsbDeviceInfo& device_info) { } } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) if (ExtensionsAPIClient::Get()->ShouldAllowDetachingUsb( device_info.vendor_id, device_info.product_id)) { return true; } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) return false; } @@ -212,14 +212,14 @@ bool UsbDeviceManager::UpdateActiveConfig(const std::string& guid, return true; } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) 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) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void UsbDeviceManager::EnsureConnectionWithDeviceManager() { if (device_manager_) diff --git a/extensions/browser/api/usb/usb_device_manager.h b/extensions/browser/api/usb/usb_device_manager.h index 318320986b65f6..13eacd113427ef 100644 --- a/extensions/browser/api/usb/usb_device_manager.h +++ b/extensions/browser/api/usb/usb_device_manager.h @@ -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) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void CheckAccess( const std::string& guid, device::mojom::UsbDeviceManager::CheckAccessCallback callback); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void EnsureConnectionWithDeviceManager(); diff --git a/services/device/hid/hid_service_linux.cc b/services/device/hid/hid_service_linux.cc index b975851f15eac0..9a9c71e61e0102 100644 --- a/services/device/hid/hid_service_linux.cc +++ b/services/device/hid/hid_service_linux.cc @@ -36,11 +36,9 @@ #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" // nogncheck +#include "chromeos/dbus/permission_broker/permission_broker_client.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) namespace device { diff --git a/services/device/public/cpp/test/fake_usb_device_manager.cc b/services/device/public/cpp/test/fake_usb_device_manager.cc index 1a3868e06770cf..39818ca37fb1b1 100644 --- a/services/device/public/cpp/test/fake_usb_device_manager.cc +++ b/services/device/public/cpp/test/fake_usb_device_manager.cc @@ -84,7 +84,7 @@ void FakeUsbDeviceManager::RefreshDeviceInfo( } #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void FakeUsbDeviceManager::CheckAccess(const std::string& guid, CheckAccessCallback callback) { std::move(callback).Run(true); @@ -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) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void FakeUsbDeviceManager::SetClient( mojo::PendingAssociatedRemote client) { diff --git a/services/device/public/cpp/test/fake_usb_device_manager.h b/services/device/public/cpp/test/fake_usb_device_manager.h index 7a91db76ddc892..d90eec1262ad3a 100644 --- a/services/device/public/cpp/test/fake_usb_device_manager.h +++ b/services/device/public/cpp/test/fake_usb_device_manager.h @@ -86,7 +86,7 @@ class FakeUsbDeviceManager : public mojom::UsbDeviceManager { RefreshDeviceInfoCallback callback) override; #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void CheckAccess(const std::string& guid, CheckAccessCallback callback) override; @@ -94,7 +94,7 @@ class FakeUsbDeviceManager : public mojom::UsbDeviceManager { uint32_t drop_privileges_mask, mojo::PlatformHandle lifeline_fd, OpenFileDescriptorCallback callback) override; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void SetClient(mojo::PendingAssociatedRemote client) override; diff --git a/services/device/public/mojom/usb_manager.mojom b/services/device/public/mojom/usb_manager.mojom index ec78190001a98d..d48d42cb92abba 100644 --- a/services/device/public/mojom/usb_manager.mojom +++ b/services/device/public/mojom/usb_manager.mojom @@ -41,7 +41,7 @@ interface UsbDeviceManager { // Check whether permission_broker will allow a future Open call for // a given USB device to succeed. - [EnableIf=is_chromeos] + [EnableIf=is_chromeos_ash] CheckAccess(string guid) => (bool success); // Attempt to open a USB device using permission_broker and return @@ -49,7 +49,7 @@ interface UsbDeviceManager { // |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] + [EnableIf=is_chromeos_ash] OpenFileDescriptor(string guid, uint32 allowed_interfaces_mask, handle lifeline_fd) => (mojo_base.mojom.File? fd); diff --git a/services/device/serial/serial_io_handler.cc b/services/device/serial/serial_io_handler.cc index f6d87157ce3164..b26b3d970df217 100644 --- a/services/device/serial/serial_io_handler.cc +++ b/services/device/serial/serial_io_handler.cc @@ -19,9 +19,9 @@ #include "build/chromeos_buildflags.h" #include "components/device_event_log/device_event_log.h" -#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) +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "chromeos/dbus/permission_broker/permission_broker_client.h" +#endif // BUILDFLAG(IS_CHROMEOS_ASH) namespace device { @@ -51,7 +51,7 @@ void SerialIoHandler::Open(const mojom::SerialConnectionOptions& options, DCHECK(ui_thread_task_runner_.get()); MergeConnectionOptions(options); -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) // Note: dbus clients are destroyed in PostDestroyThreads so passing |client| // as unretained is safe. auto* client = chromeos::PermissionBrokerClient::Get(); @@ -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) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void SerialIoHandler::OnPathOpened( scoped_refptr io_thread_task_runner, @@ -105,7 +105,7 @@ void SerialIoHandler::ReportPathOpenError(const std::string& error_name, std::move(open_complete_).Run(false); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif void SerialIoHandler::MergeConnectionOptions( const mojom::SerialConnectionOptions& options) { diff --git a/services/device/serial/serial_io_handler.h b/services/device/serial/serial_io_handler.h index 118e0ef24b42e7..bbc0426a7862fb 100644 --- a/services/device/serial/serial_io_handler.h +++ b/services/device/serial/serial_io_handler.h @@ -44,7 +44,7 @@ class SerialIoHandler : public base::RefCountedThreadSafe { virtual void Open(const mojom::SerialConnectionOptions& options, OpenCompleteCallback callback); -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) // Signals that the port has been opened. void OnPathOpened( scoped_refptr io_thread_task_runner, @@ -59,7 +59,7 @@ class SerialIoHandler : public base::RefCountedThreadSafe { // 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) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) // Performs an async read operation. Behavior is undefined if this is called // while a read is already pending. Otherwise, |callback| will eventually be diff --git a/services/device/usb/BUILD.gn b/services/device/usb/BUILD.gn index 348e9227a1d0d3..834c3473a8a3de 100644 --- a/services/device/usb/BUILD.gn +++ b/services/device/usb/BUILD.gn @@ -149,7 +149,7 @@ static_library("usb") { ] } - if (is_chromeos_ash || is_chromeos_lacros) { + if (is_chromeos_ash) { deps += [ "//chromeos/dbus/permission_broker", "//dbus", diff --git a/services/device/usb/mojo/device_manager_impl.cc b/services/device/usb/mojo/device_manager_impl.cc index 2ba6ce101d3e94..3c963cc43297e3 100644 --- a/services/device/usb/mojo/device_manager_impl.cc +++ b/services/device/usb/mojo/device_manager_impl.cc @@ -25,10 +25,10 @@ #include "services/device/usb/usb_device.h" #include "services/device/usb/usb_service.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/dbus/permission_broker/permission_broker_client.h" // nogncheck +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "chromeos/dbus/permission_broker/permission_broker_client.h" #include "services/device/usb/usb_device_linux.h" -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) namespace device { namespace usb { @@ -118,7 +118,7 @@ void DeviceManagerImpl::OnPermissionGrantedToRefresh( } #endif // defined(OS_ANDROID) -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void DeviceManagerImpl::CheckAccess(const std::string& guid, CheckAccessCallback callback) { scoped_refptr device = usb_service_->GetDevice(guid); @@ -172,7 +172,7 @@ void DeviceManagerImpl::OnOpenFileDescriptorError( << message; std::move(callback).Run(base::File()); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void DeviceManagerImpl::SetClient( mojo::PendingAssociatedRemote client) { diff --git a/services/device/usb/mojo/device_manager_impl.h b/services/device/usb/mojo/device_manager_impl.h index b57cdee9168a3a..38b7f9daa168d6 100644 --- a/services/device/usb/mojo/device_manager_impl.h +++ b/services/device/usb/mojo/device_manager_impl.h @@ -71,7 +71,7 @@ class DeviceManagerImpl : public mojom::UsbDeviceManager, bool granted); #endif // defined(OS_ANDROID) -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void CheckAccess(const std::string& guid, CheckAccessCallback callback) override; @@ -86,7 +86,7 @@ class DeviceManagerImpl : public mojom::UsbDeviceManager, void OnOpenFileDescriptorError(OpenFileDescriptorCallback callback, const std::string& error_name, const std::string& message); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void SetClient(mojo::PendingAssociatedRemote client) override; diff --git a/services/device/usb/usb_device_linux.cc b/services/device/usb/usb_device_linux.cc index 47fbedc9693d9e..de5e39df436b8e 100644 --- a/services/device/usb/usb_device_linux.cc +++ b/services/device/usb/usb_device_linux.cc @@ -23,13 +23,13 @@ #include "services/device/usb/usb_device_handle_usbfs.h" #include "services/device/usb/usb_service.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) #include "chromeos/dbus/permission_broker/permission_broker_client.h" namespace { constexpr uint32_t kAllInterfacesMask = ~0U; } // namespace -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) namespace device { @@ -40,7 +40,7 @@ UsbDeviceLinux::UsbDeviceLinux(const std::string& device_path, UsbDeviceLinux::~UsbDeviceLinux() = default; -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void UsbDeviceLinux::CheckUsbAccess(ResultCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -48,12 +48,12 @@ void UsbDeviceLinux::CheckUsbAccess(ResultCallback callback) { std::move(callback)); } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void UsbDeviceLinux::Open(OpenCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) // create the pipe used as a lifetime to re-attach the original kernel driver // to the USB device in permission_broker. base::ScopedFD read_end, write_end; @@ -78,10 +78,10 @@ void UsbDeviceLinux::Open(OpenCallback callback) { base::BindOnce(&UsbDeviceLinux::OpenOnBlockingThread, this, std::move(callback), base::ThreadTaskRunnerHandle::Get(), blocking_task_runner)); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void UsbDeviceLinux::OnOpenRequestComplete(OpenCallback callback, base::ScopedFD lifeline_fd, @@ -122,7 +122,7 @@ void UsbDeviceLinux::OpenOnBlockingThread( } } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void UsbDeviceLinux::Opened( base::ScopedFD fd, diff --git a/services/device/usb/usb_device_linux.h b/services/device/usb/usb_device_linux.h index 2ea0f61296196e..70a10700893eef 100644 --- a/services/device/usb/usb_device_linux.h +++ b/services/device/usb/usb_device_linux.h @@ -29,9 +29,9 @@ struct UsbDeviceDescriptor; class UsbDeviceLinux : public UsbDevice { public: // UsbDevice implementation: -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void CheckUsbAccess(ResultCallback callback) override; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void Open(OpenCallback callback) override; const std::string& device_path() const { return device_path_; } @@ -52,7 +52,7 @@ class UsbDeviceLinux : public UsbDevice { ~UsbDeviceLinux() override; private: -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#if BUILDFLAG(IS_CHROMEOS_ASH) void OnOpenRequestComplete(OpenCallback callback, base::ScopedFD fd, base::ScopedFD lifeline_fd); @@ -64,7 +64,7 @@ class UsbDeviceLinux : public UsbDevice { OpenCallback callback, scoped_refptr task_runner, scoped_refptr blocking_task_runner); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) +#endif // BUILDFLAG(IS_CHROMEOS_ASH) void Opened(base::ScopedFD fd, base::ScopedFD lifeline_fd, OpenCallback callback,