# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

abi <abi/3.0>,

include <tunables/global>

@{name} = chrome{,-beta,-stable,-unstable}
@{domain} = com.google.Chrome
@{lib_dirs} = /opt/google/@{name}
@{config_dirs} = @{user_config_dirs}/google-@{name}
@{cache_dirs} = @{user_cache_dirs}/google-@{name}

@{exec_path} = @{lib_dirs}/@{name}
profile chrome @{exec_path} {
  include <abstractions/base>
  include <abstractions/app/chromium>

  @{exec_path} mrix,

  @{bin}/man  rPUx, #  For "chrome --help"

  @{lib_dirs}/google-@{name}  rPx,

  @{lib_dirs}/nacl_helper    rix,
  @{lib_dirs}/xdg-mime       rix, #-> xdg-mime,
  @{lib_dirs}/xdg-settings   rix, #-> xdg-settings,

  @{lib_dirs}/*.so* mr,
  @{lib_dirs}/libwidevinecdm.so mr,
  @{lib_dirs}/libwidevinecdmadapter.so mr,
  @{lib_dirs}/WidevineCdm/_platform_specific/linux_*/libwidevinecdm.so mr,

  include if exists <local/chrome>
}
