diff --git a/arm/android/media/base/supported_types.cc b/arm/android/media/base/supported_types.cc index 16df37bb..0b2f596d 100644 --- a/arm/android/media/base/supported_types.cc +++ b/arm/android/media/base/supported_types.cc @@ -355,9 +355,7 @@ bool IsDefaultSupportedAudioType(const AudioType& type) { case AudioCodec::kAMR_NB: case AudioCodec::kAMR_WB: case AudioCodec::kGSM_MS: - case AudioCodec::kEAC3: case AudioCodec::kALAC: - case AudioCodec::kAC3: case AudioCodec::kMpegHAudio: case AudioCodec::kUnknown: return false; @@ -368,6 +366,13 @@ bool IsDefaultSupportedAudioType(const AudioType& type) { return true; #else return false; +#endif + case AudioCodec::kAC3: + case AudioCodec::kEAC3: +#if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) + return true; +#else + return false; #endif } } @@ -379,7 +384,7 @@ bool IsBuiltInVideoCodec(VideoCodec codec) { if (codec == VideoCodec::kVP8) return true; #if BUILDFLAG(USE_PROPRIETARY_CODECS) - if (codec == VideoCodec::kH264) + if (codec == VideoCodec::kH264 || codec == VideoCodec::kHEVC) return true; #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) #endif // BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS) diff --git a/arm/android/media/ffmpeg/ffmpeg_common.cc b/arm/android/media/ffmpeg/ffmpeg_common.cc index 65c7a495..7c2f615e 100644 --- a/arm/android/media/ffmpeg/ffmpeg_common.cc +++ b/arm/android/media/ffmpeg/ffmpeg_common.cc @@ -740,7 +740,7 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, AVMasteringDisplayMetadata* metadata = reinterpret_cast(side_data.data); if (metadata->has_primaries) { - hdr_metadata.color_volume_metadata.primaries = { + hdr_metadata.smpte_st_2086.primaries = { static_cast(av_q2d(metadata->display_primaries[0][0])), static_cast(av_q2d(metadata->display_primaries[0][1])), static_cast(av_q2d(metadata->display_primaries[1][0])), @@ -752,9 +752,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, }; } if (metadata->has_luminance) { - hdr_metadata.color_volume_metadata.luminance_max = + hdr_metadata.smpte_st_2086.luminance_max = av_q2d(metadata->max_luminance); - hdr_metadata.color_volume_metadata.luminance_min = + hdr_metadata.smpte_st_2086.luminance_min = av_q2d(metadata->min_luminance); } } @@ -910,26 +910,6 @@ VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) { return PIXEL_FORMAT_UNKNOWN; } -VideoColorSpace AVColorSpaceToColorSpace(AVColorSpace color_space, - AVColorRange color_range) { - // TODO(hubbe): make this better - if (color_range == AVCOL_RANGE_JPEG) - return VideoColorSpace::JPEG(); - - switch (color_space) { - case AVCOL_SPC_UNSPECIFIED: - break; - case AVCOL_SPC_BT709: - return VideoColorSpace::REC709(); - case AVCOL_SPC_SMPTE170M: - case AVCOL_SPC_BT470BG: - return VideoColorSpace::REC601(); - default: - DVLOG(1) << "Unknown AVColorSpace: " << color_space; - } - return VideoColorSpace(); -} - std::string AVErrorToString(int errnum) { char errbuf[AV_ERROR_MAX_STRING_SIZE] = {0}; av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); diff --git a/arm/android/media/media_options.gni b/arm/android/media/media_options.gni index cdc3e937..59886659 100644 --- a/arm/android/media/media_options.gni +++ b/arm/android/media/media_options.gni @@ -113,6 +113,10 @@ declare_args() { enable_hevc_parser_and_hw_decoder = proprietary_codecs && (use_fuzzing_engine || is_win || is_mac || is_android || is_linux) + + # Enable inclusion of VVC/H.266 parser/demuxer, and also enable VVC/H.266 decoding + # with hardware acceleration provided by platform. Disabled by default for all builds. + enable_platform_vvc = false } # Use another declare_args() to allow dependence on args defined above. diff --git a/arm/raspi/media/base/supported_types.cc b/arm/raspi/media/base/supported_types.cc index 83198116..0b2f596d 100644 --- a/arm/raspi/media/base/supported_types.cc +++ b/arm/raspi/media/base/supported_types.cc @@ -355,9 +355,7 @@ bool IsDefaultSupportedAudioType(const AudioType& type) { case AudioCodec::kAMR_NB: case AudioCodec::kAMR_WB: case AudioCodec::kGSM_MS: - case AudioCodec::kEAC3: case AudioCodec::kALAC: - case AudioCodec::kAC3: case AudioCodec::kMpegHAudio: case AudioCodec::kUnknown: return false; @@ -368,6 +366,13 @@ bool IsDefaultSupportedAudioType(const AudioType& type) { return true; #else return false; +#endif + case AudioCodec::kAC3: + case AudioCodec::kEAC3: +#if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) + return true; +#else + return false; #endif } } diff --git a/arm/raspi/media/ffmpeg/ffmpeg_common.cc b/arm/raspi/media/ffmpeg/ffmpeg_common.cc index 65c7a495..7c2f615e 100644 --- a/arm/raspi/media/ffmpeg/ffmpeg_common.cc +++ b/arm/raspi/media/ffmpeg/ffmpeg_common.cc @@ -740,7 +740,7 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, AVMasteringDisplayMetadata* metadata = reinterpret_cast(side_data.data); if (metadata->has_primaries) { - hdr_metadata.color_volume_metadata.primaries = { + hdr_metadata.smpte_st_2086.primaries = { static_cast(av_q2d(metadata->display_primaries[0][0])), static_cast(av_q2d(metadata->display_primaries[0][1])), static_cast(av_q2d(metadata->display_primaries[1][0])), @@ -752,9 +752,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, }; } if (metadata->has_luminance) { - hdr_metadata.color_volume_metadata.luminance_max = + hdr_metadata.smpte_st_2086.luminance_max = av_q2d(metadata->max_luminance); - hdr_metadata.color_volume_metadata.luminance_min = + hdr_metadata.smpte_st_2086.luminance_min = av_q2d(metadata->min_luminance); } } @@ -910,26 +910,6 @@ VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) { return PIXEL_FORMAT_UNKNOWN; } -VideoColorSpace AVColorSpaceToColorSpace(AVColorSpace color_space, - AVColorRange color_range) { - // TODO(hubbe): make this better - if (color_range == AVCOL_RANGE_JPEG) - return VideoColorSpace::JPEG(); - - switch (color_space) { - case AVCOL_SPC_UNSPECIFIED: - break; - case AVCOL_SPC_BT709: - return VideoColorSpace::REC709(); - case AVCOL_SPC_SMPTE170M: - case AVCOL_SPC_BT470BG: - return VideoColorSpace::REC601(); - default: - DVLOG(1) << "Unknown AVColorSpace: " << color_space; - } - return VideoColorSpace(); -} - std::string AVErrorToString(int errnum) { char errbuf[AV_ERROR_MAX_STRING_SIZE] = {0}; av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); diff --git a/infra/THORIUM_DEV_BOOKMARKS.html b/infra/THORIUM_DEV_BOOKMARKS.html index 9e66f2f0..cbea193c 100644 --- a/infra/THORIUM_DEV_BOOKMARKS.html +++ b/infra/THORIUM_DEV_BOOKMARKS.html @@ -203,7 +203,7 @@
ffmpeg_common.cc - Chromium Code Search
BUILD.gn - Chromium Code Search
media_options.gni - Chromium Code Search -
ignores.txt - Chromium Code Search +
ignores.txt - Chromium Code Search

Th23

diff --git a/infra/TODO.md b/infra/TODO.md index aa414164..89b34b40 100644 --- a/infra/TODO.md +++ b/infra/TODO.md @@ -8,10 +8,6 @@ - https://github.com/ungoogled-software/ungoogled-chromium/pull/2314/files -- Add env variables for all scripts for chromium src dir location - - - https://github.com/Alex313031/thorium/blob/main/trunk.sh - - Update build instructions and add Mac build instructions (also merge to website) - https://github.com/Alex313031/thorium/blob/main/trunk.sh @@ -19,3 +15,12 @@ - Update win scripts to work seamlessly - https://github.com/Alex313031/thorium/tree/main/win_scripts + +- Re-evaluate vector icons and webui images for CR23 refresh + + - To keep .icons correct + +- Add new Thorium shortcuts to ThoriumOS Shortcuts App + + - For ChromeOS only: If you plan on adding a new accelerator and want it + displayed in the Shortcuts app, please follow the instructions at: `ash/webui/shortcut_customization_ui/backend/accelerator_layout_table.h`. diff --git a/infra/portable/THORIUM_SHELL.BAT b/infra/portable/THORIUM_SHELL.BAT index 77044351..4cd0ade8 100644 --- a/infra/portable/THORIUM_SHELL.BAT +++ b/infra/portable/THORIUM_SHELL.BAT @@ -1 +1 @@ -START "" "%cd%\BIN\114.0.5735.205\thorium_shell.exe" --data-path="%~dp0%\USER_DATA\thorium_shell" --allow-outdated-plugins --disable-logging --disable-breakpad --enable-experimental-web-platform-features --new-canvas-2d-api +START "" "%cd%\BIN\115.0.5790.172\thorium_shell.exe" --data-path="%~dp0%\USER_DATA\thorium_shell" --allow-outdated-plugins --disable-logging --disable-breakpad --enable-experimental-web-platform-features --new-canvas-2d-api diff --git a/src/build/install-build-deps.py b/src/build/install-build-deps.py new file mode 100755 index 00000000..3fb81539 --- /dev/null +++ b/src/build/install-build-deps.py @@ -0,0 +1,930 @@ +#!/usr/bin/env python3 + +# Copyright 2023 The Chromium Authors and Alex313031 +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Script to install everything needed to build chromium +# including items requiring sudo privileges. +# See https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md + +import argparse +import functools +import os +import re +import shutil +import subprocess +import sys + + +@functools.lru_cache(maxsize=1) +def build_apt_package_list(): + print("Building apt package list.", file=sys.stderr) + output = subprocess.check_output(["apt-cache", "dumpavail"]).decode() + arch_map = {"i386": ":i386"} + package_regex = re.compile(r"^Package: (.+?)$.+?^Architecture: (.+?)$", + re.M | re.S) + return set(package + arch_map.get(arch, "") + for package, arch in re.findall(package_regex, output)) + + +def package_exists(package_name: str) -> bool: + return package_name in build_apt_package_list() + + +def parse_args(argv): + parser = argparse.ArgumentParser( + description="Install Chromium build dependencies.") + parser.add_argument("--syms", + action="store_true", + help="Enable installation of debugging symbols") + parser.add_argument( + "--no-syms", + action="store_false", + dest="syms", + help="Disable installation of debugging symbols", + ) + parser.add_argument( + "--lib32", + action="store_true", + help="Enable installation of 32-bit libraries, e.g. for V8 snapshot", + ) + parser.add_argument( + "--android", + action="store_true", + help="Enable installation of android dependencies", + ) + parser.add_argument( + "--no-android", + action="store_false", + dest="android", + help="Disable installation of android dependencies", + ) + parser.add_argument("--arm", + action="store_true", + help="Enable installation of arm cross toolchain") + parser.add_argument( + "--no-arm", + action="store_false", + dest="arm", + help="Disable installation of arm cross toolchain", + ) + parser.add_argument( + "--chromeos-fonts", + action="store_true", + help="Enable installation of Chrome OS fonts", + ) + parser.add_argument( + "--no-chromeos-fonts", + action="store_false", + dest="chromeos_fonts", + help="Disable installation of Chrome OS fonts", + ) + parser.add_argument( + "--nacl", + action="store_true", + help="Enable installation of prerequisites for building NaCl", + ) + parser.add_argument( + "--no-nacl", + action="store_false", + dest="nacl", + help="Disable installation of prerequisites for building NaCl", + ) + parser.add_argument( + "--backwards-compatible", + action="store_true", + help= + "Enable installation of packages that are no longer currently needed and" + + "have been removed from this script. Useful for bisection.", + ) + parser.add_argument( + "--no-backwards-compatible", + action="store_false", + dest="backwards_compatible", + help= + "Disable installation of packages that are no longer currently needed and" + + "have been removed from this script.", + ) + parser.add_argument("--no-prompt", + action="store_true", + help="Automatic yes to prompts") + parser.add_argument( + "--quick-check", + action="store_true", + help="Quickly try to determine if dependencies are installed", + ) + parser.add_argument( + "--unsupported", + action="store_true", + help="Attempt installation even on unsupported systems", + ) + + options = parser.parse_args(argv) + + if options.arm or options.android: + options.lib32 = True + + return options + + +def check_lsb_release(): + if not shutil.which("lsb_release"): + print("ERROR: lsb_release not found in $PATH", file=sys.stderr) + print("try: sudo apt-get install lsb-release", file=sys.stderr) + sys.exit(1) + + +@functools.lru_cache(maxsize=1) +def distro_codename(): + return subprocess.check_output(["lsb_release", "--codename", + "--short"]).decode().strip() + + +def check_distro(options): + if options.unsupported or options.quick_check: + return + + distro_id = subprocess.check_output(["lsb_release", "--id", + "--short"]).decode().strip() + + supported_codenames = ["bionic", "focal", "jammy", "kinetic", "lunar"] + supported_ids = ["Debian"] + + if (distro_codename() not in supported_codenames + and distro_id not in supported_ids): + print( + "WARNING: The following distributions are supported,", + "but distributions not in the list below can also try to install", + "dependencies by passing the `--unsupported` parameter", + "\tUbuntu 18.04 LTS (bionic with EoL April 2028)", + "\tUbuntu 20.04 LTS (focal with EoL April 2030)", + "\tUbuntu 22.04 LTS (jammy with EoL April 2032)", + "\tUbuntu 22.10 (kinetic with EoL October 2023)\n" \ + "\tUbuntu 23.04 (lunar with EoL April 2024)\n" \ + "\tDebian 10 (buster), 11 (bullseye) or 12 (bookworm)", + sep="\n", + file=sys.stderr, + ) + sys.exit(1) + + +def check_architecture(): + architecture = subprocess.check_output(["uname", "-m"]).decode().strip() + if architecture not in ["i686", "x86_64"]: + print("Only x86 architectures are currently supported", file=sys.stderr) + sys.exit(1) + + +def check_root(): + if os.geteuid() != 0: + print("Running as non-root user.", file=sys.stderr) + print("You might have to enter your password one or more times for 'sudo'.", + file=sys.stderr) + print(file=sys.stderr) + + +def apt_update(options): + if options.lib32 or options.nacl: + subprocess.check_call(["sudo", "dpkg", "--add-architecture", "i386"]) + subprocess.check_call(["sudo", "apt-get", "update"]) + + +# Packages needed for development +def dev_list(): + packages = [ + "binutils", + "bison", + "bzip2", + "cdbs", + "curl", + "dbus-x11", + "devscripts", + "dpkg-dev", + "elfutils", + "fakeroot", + "flex", + "git-core", + "gperf", + "icoutils", + "libasound2-dev", + "libatspi2.0-dev", + "libbrlapi-dev", + "libbz2-dev", + "libc6-dev", + "libcairo2-dev", + "libcap-dev", + "libcups2-dev", + "libcurl4-gnutls-dev", + "libdrm-dev", + "libelf-dev", + "libevdev-dev", + "libffi-dev", + "libgbm-dev", + "libglib2.0-dev", + "libglu1-mesa-dev", + "libgtk-3-dev", + "libkrb5-dev", + "libnspr4-dev", + "libnss3-dev", + "libpam0g-dev", + "libpci-dev", + "libpulse-dev", + "libsctp-dev", + "libspeechd-dev", + "libsqlite3-dev", + "libssl-dev", + "libsystemd-dev", + "libudev-dev", + "libva-dev", + "libwww-perl", + "libxshmfence-dev", + "libxslt1-dev", + "libxss-dev", + "libxt-dev", + "libxtst-dev", + "lighttpd", + "locales", + "openbox", + "p7zip", + "patch", + "perl", + "pkg-config", + "rpm", + "ruby", + "subversion", + "uuid-dev", + "wdiff", + "wget", + "x11-utils", + "xcompmgr", + "xz-utils", + "zip", + ] + + # Packages needed for chromeos only + packages += [ + "libbluetooth-dev", + "libxkbcommon-dev", + "mesa-common-dev", + "zstd", + ] + + if package_exists("realpath"): + packages.append("realpath") + + if package_exists("libjpeg-dev"): + packages.append("libjpeg-dev") + else: + packages.append("libjpeg62-dev") + + if package_exists("libudev1"): + packages.append("libudev1") + else: + packages.append("libudev0") + + if package_exists("libbrlapi0.8"): + packages.append("libbrlapi0.8") + elif package_exists("libbrlapi0.7"): + packages.append("libbrlapi0.7") + elif package_exists("libbrlapi0.6"): + packages.append("libbrlapi0.6") + else: + packages.append("libbrlapi0.5") + + if package_exists("libav-tools"): + packages.append("libav-tools") + + if package_exists("libvulkan-dev"): + packages.append("libvulkan-dev") + + if package_exists("libinput-dev"): + packages.append("libinput-dev") + + # Cross-toolchain strip is needed for building the sysroots. + if package_exists("binutils-arm-linux-gnueabihf"): + packages.append("binutils-arm-linux-gnueabihf") + if package_exists("binutils-aarch64-linux-gnu"): + packages.append("binutils-aarch64-linux-gnu") + if package_exists("binutils-mipsel-linux-gnu"): + packages.append("binutils-mipsel-linux-gnu") + if package_exists("binutils-mips64el-linux-gnuabi64"): + packages.append("binutils-mips64el-linux-gnuabi64") + + # 64-bit systems need a minimum set of 32-bit compat packages for the + # pre-built NaCl binaries. + if "ELF 64-bit" in subprocess.check_output(["file", "-L", + "/sbin/init"]).decode(): + packages.extend(["libc6-i386", "lib32stdc++6"]) + + # lib32gcc-s1 used to be called lib32gcc1 in older distros. + if package_exists("lib32gcc-s1"): + packages.append("lib32gcc-s1") + elif package_exists("lib32gcc1"): + packages.append("lib32gcc1") + + return packages + + +# List of required run-time libraries +def lib_list(): + packages = [ + "lib32z1", + "libasound2", + "libatk1.0-0", + "libatspi2.0-0", + "libc6", + "libcairo2", + "libcap2", + "libcgi-session-perl", + "libcups2", + "libdrm2", + "libegl1", + "libevdev2", + "libexpat1", + "libfontconfig1", + "libfreetype6", + "libgbm1", + "libglib2.0-0", + "libgl1", + "libgtk-3-0", + "libncurses5", + "libpam0g", + "libpango-1.0-0", + "libpangocairo-1.0-0", + "libpci3", + "libpcre3", + "libpixman-1-0", + "libspeechd2", + "libstdc++6", + "libsqlite3-0", + "libuuid1", + "libwayland-egl1", + "libwayland-egl1-mesa", + "libx11-6", + "libx11-xcb1", + "libxau6", + "libxcb1", + "libxcomposite1", + "libxcursor1", + "libxdamage1", + "libxdmcp6", + "libxext6", + "libxfixes3", + "libxi6", + "libxinerama1", + "libxrandr2", + "libxrender1", + "libxtst6", + "x11-utils", + "xvfb", + "zlib1g", + ] + + # Run-time libraries required by chromeos only + packages += [ + "libpulse0", + "libbz2-1.0", + ] + + if package_exists("libffi8"): + packages.append("libffi8") + elif package_exists("libffi7"): + packages.append("libffi7") + elif package_exists("libffi6"): + packages.append("libffi6") + + if package_exists("libpng16-16"): + packages.append("libpng16-16") + else: + packages.append("libpng12-0") + + if package_exists("libnspr4"): + packages.extend(["libnspr4", "libnss3"]) + else: + packages.extend(["libnspr4-0d", "libnss3-1d"]) + + if package_exists("appmenu-gtk"): + packages.append("appmenu-gtk") + if package_exists("libgnome-keyring0"): + packages.append("libgnome-keyring0") + if package_exists("libgnome-keyring-dev"): + packages.append("libgnome-keyring-dev") + if package_exists("libvulkan1"): + packages.append("libvulkan1") + if package_exists("libinput10"): + packages.append("libinput10") + + return packages + + +def lib32_list(options): + if not options.lib32: + print("Skipping 32-bit libraries.", file=sys.stderr) + return [] + print("Including 32-bit libraries.", file=sys.stderr) + + packages = [ + # 32-bit libraries needed for a 32-bit build + # includes some 32-bit libraries required by the Android SDK + # See https://developer.android.com/sdk/installing/index.html?pkg=tools + "libasound2:i386", + "libatk-bridge2.0-0:i386", + "libatk1.0-0:i386", + "libatspi2.0-0:i386", + "libdbus-1-3:i386", + "libegl1:i386", + "libgl1:i386", + "libglib2.0-0:i386", + "libncurses5:i386", + "libnss3:i386", + "libpango-1.0-0:i386", + "libpangocairo-1.0-0:i386", + "libstdc++6:i386", + "libwayland-egl1:i386", + "libx11-xcb1:i386", + "libxcomposite1:i386", + "libxdamage1:i386", + "libxkbcommon0:i386", + "libxrandr2:i386", + "libxtst6:i386", + "zlib1g:i386", + # 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf + "linux-libc-dev-i386-cross", + "libpci3:i386", + ] + + # When cross building for arm/Android on 64-bit systems the host binaries + # that are part of v8 need to be compiled with -m32 which means + # that basic multilib support is needed. + if "ELF 64-bit" in subprocess.check_output(["file", "-L", + "/sbin/init"]).decode(): + # gcc-multilib conflicts with the arm cross compiler but + # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the + # appropriate value of X and Y by seeing what version the current + # distribution's g++-multilib package depends on. + lines = subprocess.check_output( + ["apt-cache", "depends", "g++-multilib", "--important"]).decode() + pattern = re.compile(r"g\+\+-[0-9.]+-multilib") + packages += re.findall(pattern, lines) + + return packages + + +# Packages that have been removed from this script. Regardless of configuration +# or options passed to this script, whenever a package is removed, it should be +# added here. +def backwards_compatible_list(options): + if not options.backwards_compatible: + print("Skipping backwards compatible packages.", file=sys.stderr) + return [] + print("Including backwards compatible packages.", file=sys.stderr) + + packages = [ + "7za", + "fonts-indic", + "fonts-ipafont", + "fonts-stix", + "fonts-thai-tlwg", + "fonts-tlwg-garuda", + "g++", + "g++-4.8-multilib-arm-linux-gnueabihf", + "gcc-4.8-multilib-arm-linux-gnueabihf", + "g++-9-multilib-arm-linux-gnueabihf", + "gcc-9-multilib-arm-linux-gnueabihf", + "gcc-arm-linux-gnueabihf", + "g++-10-multilib-arm-linux-gnueabihf", + "gcc-10-multilib-arm-linux-gnueabihf", + "g++-10-arm-linux-gnueabihf", + "gcc-10-arm-linux-gnueabihf", + "git-svn", + "language-pack-da", + "language-pack-fr", + "language-pack-he", + "language-pack-zh-hant", + "libappindicator-dev", + "libappindicator1", + "libappindicator3-1", + "libappindicator3-dev", + "libdconf-dev", + "libdconf1", + "libdconf1:i386", + "libexif-dev", + "libexif12", + "libexif12:i386", + "libgbm-dev", + "libgbm-dev-lts-trusty", + "libgbm-dev-lts-xenial", + "libgconf-2-4:i386", + "libgconf2-dev", + "libgl1-mesa-dev", + "libgl1-mesa-dev-lts-trusty", + "libgl1-mesa-dev-lts-xenial", + "libgl1-mesa-glx:i386", + "libgl1-mesa-glx-lts-trusty:i386", + "libgl1-mesa-glx-lts-xenial:i386", + "libgles2-mesa-dev", + "libgles2-mesa-dev-lts-trusty", + "libgles2-mesa-dev-lts-xenial", + "libgtk-3-0:i386", + "libgtk2.0-0", + "libgtk2.0-0:i386", + "libgtk2.0-dev", + "mesa-common-dev", + "mesa-common-dev-lts-trusty", + "mesa-common-dev-lts-xenial", + "msttcorefonts", + "python-dev", + "python-setuptools", + "snapcraft", + "ttf-dejavu-core", + "ttf-indic-fonts", + "ttf-kochi-gothic", + "ttf-kochi-mincho", + "ttf-mscorefonts-installer", + "xfonts-mathml", + ] + + if package_exists("python-is-python2"): + packages.extend(["python-is-python2", "python2-dev"]) + else: + packages.append("python") + + if package_exists("python-crypto"): + packages.append("python-crypto") + + if package_exists("python-numpy"): + packages.append("python-numpy") + + if package_exists("python-openssl"): + packages.append("python-openssl") + + if package_exists("python-psutil"): + packages.append("python-psutil") + + if package_exists("python-yaml"): + packages.append("python-yaml") + + if package_exists("apache2.2-bin"): + packages.append("apache2.2-bin") + else: + packages.append("apache2-bin") + + php_versions = [ + ("php8.1-cgi", "libapache2-mod-php8.1"), + ("php8.0-cgi", "libapache2-mod-php8.0"), + ("php7.4-cgi", "libapache2-mod-php7.4"), + ("php7.3-cgi", "libapache2-mod-php7.3"), + ("php7.2-cgi", "libapache2-mod-php7.2"), + ("php7.1-cgi", "libapache2-mod-php7.1"), + ("php7.0-cgi", "libapache2-mod-php7.0"), + ("php5-cgi", "libapache2-mod-php5"), + ] + + for php_cgi, mod_php in php_versions: + if package_exists(php_cgi): + packages.extend([php_cgi, mod_php]) + break + + return [package for package in packages if package_exists(package)] + + +def arm_list(options): + if not options.arm: + print("Skipping ARM cross toolchain.", file=sys.stderr) + return [] + print("Including ARM cross toolchain.", file=sys.stderr) + + # arm cross toolchain packages needed to build chrome on armhf + packages = [ + "libc6-dev-armhf-cross", + "libc6-dev-arm64-cross", + "linux-libc-dev-armhf-cross", + "linux-libc-dev-arm64-cross", + "g++-arm-linux-gnueabihf", + ] + + # Work around for dependency issue Ubuntu: http://crbug.com/435056 + if distro_codename() == "bionic": + packages.extend([ + "g++-5-multilib-arm-linux-gnueabihf", + "gcc-5-multilib-arm-linux-gnueabihf", + "gcc-arm-linux-gnueabihf", + ]) + elif distro_codename() == "focal": + packages.extend([ + "g++-10-multilib-arm-linux-gnueabihf", + "gcc-10-multilib-arm-linux-gnueabihf", + "gcc-arm-linux-gnueabihf", + ]) + elif distro_codename() == "jammy": + packages.extend([ + "gcc-arm-linux-gnueabihf", + "g++-11-arm-linux-gnueabihf", + "gcc-11-arm-linux-gnueabihf", + ]) + elif distro_codename() == "kinetic": + packages.extend([ + "gcc-arm-linux-gnueabihf", + "g++-11-arm-linux-gnueabihf", + "gcc-11-arm-linux-gnueabihf", + ]) + elif distro_codename() == "lunar": + packages.extend([ + "gcc-arm-linux-gnueabihf", + "g++-11-arm-linux-gnueabihf", + "gcc-11-arm-linux-gnueabihf", + ]) + + return packages + + +def nacl_list(options): + if not options.nacl: + print("Skipping NaCl, NaCl toolchain, NaCl ports dependencies.", + file=sys.stderr) + return [] + print("Including NaCl, NaCl toolchain, NaCl ports dependencies.", + file=sys.stderr) + + packages = [ + "g++-mingw-w64-i686", + "lib32z1-dev", + "libasound2:i386", + "libcap2:i386", + "libelf-dev:i386", + "libfontconfig1:i386", + "libglib2.0-0:i386", + "libgpm2:i386", + "libncurses5:i386", + "lib32ncurses5-dev", + "libnss3:i386", + "libpango-1.0-0:i386", + "libssl-dev:i386", + "libtinfo-dev", + "libtinfo-dev:i386", + "libtool", + "libuuid1:i386", + "libxcomposite1:i386", + "libxcursor1:i386", + "libxdamage1:i386", + "libxi6:i386", + "libxrandr2:i386", + "libxss1:i386", + "libxtst6:i386", + "texinfo", + "xvfb", + # Packages to build NaCl, its toolchains, and its ports. + "ant", + "autoconf", + "bison", + "cmake", + "gawk", + "intltool", + "xutils-dev", + "xsltproc", + ] + + # Some package names have changed over time + if package_exists("libssl-dev"): + packages.append("libssl-dev:i386") + elif package_exists("libssl1.1"): + packages.append("libssl1.1:i386") + elif package_exists("libssl1.0.2"): + packages.append("libssl1.0.2:i386") + else: + packages.append("libssl1.0.0:i386") + + if package_exists("libtinfo5"): + packages.append("libtinfo5") + + if package_exists("libudev1"): + packages.append("libudev1:i386") + else: + packages.append("libudev0:i386") + + return packages + + +# Debian is in the process of transitioning to automatic debug packages, which +# have the -dbgsym suffix (https://wiki.debian.org/AutomaticDebugPackages). +# Untransitioned packages have the -dbg suffix. And on some systems, neither +# will be available, so exclude the ones that are missing. +def dbg_package_name(package): + if package_exists(package + "-dbgsym"): + return [package + "-dbgsym"] + if package_exists(package + "-dbg"): + return [package + "-dbg"] + return [] + + +def dbg_list(options): + if not options.syms: + print("Skipping debugging symbols.", file=sys.stderr) + return [] + print("Including debugging symbols.", file=sys.stderr) + + packages = [ + dbg_package for package in lib_list() + for dbg_package in dbg_package_name(package) + ] + + # Debugging symbols packages not following common naming scheme + if not dbg_package_name("libstdc++6"): + for version in ["8", "7", "6", "5", "4.9", "4.8", "4.7", "4.6"]: + if package_exists("libstdc++6-%s-dbg" % version): + packages.append("libstdc++6-%s-dbg" % version) + break + + if not dbg_package_name("libatk1.0-0"): + packages.extend(dbg_package_name("libatk1.0")) + + if not dbg_package_name("libpango-1.0-0"): + packages.extend(dbg_package_name("libpango1.0-dev")) + + return packages + + +def package_list(options): + packages = (dev_list() + lib_list() + dbg_list(options) + + lib32_list(options) + arm_list(options) + nacl_list(options) + + backwards_compatible_list(options)) + + # Sort all the :i386 packages to the front, to avoid confusing dpkg-query + # (https://crbug.com/446172). + return sorted(set(packages), key=lambda x: (not x.endswith(":i386"), x)) + + +def missing_packages(packages): + try: + subprocess.run( + ["dpkg-query", "-W", "-f", " "] + packages, + check=True, + capture_output=True, + ).decode() + return [] + except subprocess.CalledProcessError as e: + return [line.split(" ")[-1] for line in e.stderr.strip().splitlines()] + + +def package_is_installable(package): + result = subprocess.run(["apt-cache", "show", package], + capture_output=True).decode() + return result.returncode == 0 + + +def quick_check(options): + if not options.quick_check: + return + + missing = missing_packages(package_list(options)) + if not missing: + sys.exit(0) + + not_installed = [] + unknown = [] + for p in missing: + if package_is_installable(p): + not_installed.append(p) + else: + unknown.append(p) + + if not_installed: + print("WARNING: The following packages are not installed:", file=sys.stderr) + print(" ".join(not_installed), file=sys.stderr) + + if unknown: + print("WARNING: The following packages are unknown to your system", + file=sys.stderr) + print("(maybe missing a repo or need to 'sudo apt-get update'):", + file=sys.stderr) + print(" ".join(unknown), file=sys.stderr) + + sys.exit(1) + + +def find_missing_packages(options): + print("Finding missing packages...", file=sys.stderr) + + packages = package_list(options) + packages_str = " ".join(packages) + print("Packages required: " + packages_str, file=sys.stderr) + + query_cmd = ["apt-get", "--just-print", "install"] + packages + env = os.environ.copy() + env["LANGUAGE"] = "en" + env["LANG"] = "C" + cmd_output = subprocess.check_output(query_cmd, env=env).decode() + lines = cmd_output.splitlines() + + install = [] + for pattern in ( + "The following NEW packages will be installed:", + "The following packages will be upgraded:", + ): + if pattern in lines: + for line in lines[lines.index(pattern) + 1:]: + if not line.startswith(" "): + break + install += line.strip().split(" ") + return install + + +def install_packages(options): + try: + packages = find_missing_packages(options) + if packages: + quiet = ["-qq", "--assume-yes"] if options.no_prompt else [] + subprocess.check_call(["sudo", "apt-get", "install"] + quiet + packages) + print(file=sys.stderr) + else: + print("No missing packages, and the packages are up to date.", + file=sys.stderr) + + except subprocess.CalledProcessError as e: + # An apt-get exit status of 100 indicates that a real error has occurred. + print("`apt-get --just-print install ...` failed", file=sys.stderr) + print("It produced the following output:", file=sys.stderr) + print(e.output.decode(), file=sys.stderr) + print(file=sys.stderr) + print("You will have to install the above packages yourself.", + file=sys.stderr) + print(file=sys.stderr) + sys.exit(100) + + +# Install the Chrome OS default fonts. This must go after running +# apt-get, since install-chromeos-fonts depends on curl. +def install_chromeos_fonts(options): + if not options.chromeos_fonts: + print("Skipping installation of Chrome OS fonts.", file=sys.stderr) + return + print("Installing Chrome OS fonts.", file=sys.stderr) + + dir = os.path.abspath(os.path.dirname(__file__)) + + try: + subprocess.check_call( + ["sudo", + os.path.join(dir, "linux", "install-chromeos-fonts.py")]) + except subprocess.CalledProcessError: + print("ERROR: The installation of the Chrome OS default fonts failed.", + file=sys.stderr) + if (subprocess.check_output( + ["stat", "-f", "-c", "%T", dir], ).decode().startswith("nfs")): + print( + "The reason is that your repo is installed on a remote file system.", + file=sys.stderr) + else: + print( + "This is expected if your repo is installed on a remote file system.", + file=sys.stderr) + + print("It is recommended to install your repo on a local file system.", + file=sys.stderr) + print("You can skip the installation of the Chrome OS default fonts with", + file=sys.stderr) + print("the command line option: --no-chromeos-fonts.", file=sys.stderr) + sys.exit(1) + + +def install_locales(): + print("Installing locales.", file=sys.stderr) + CHROMIUM_LOCALES = [ + "da_DK.UTF-8", "fr_FR.UTF-8", "he_IL.UTF-8", "zh_TW.UTF-8" + ] + LOCALE_GEN = "/etc/locale.gen" + if os.path.exists(LOCALE_GEN): + old_locale_gen = open(LOCALE_GEN).read() + for locale in CHROMIUM_LOCALES: + subprocess.check_call( + ["sudo", "sed", "-i", + "s/^# %s/%s/" % (locale, locale), LOCALE_GEN]) + + # Regenerating locales can take a while, so only do it if we need to. + locale_gen = open(LOCALE_GEN).read() + if locale_gen != old_locale_gen: + subprocess.check_call(["sudo", "locale-gen"]) + else: + print("Locales already up-to-date.", file=sys.stderr) + else: + for locale in CHROMIUM_LOCALES: + subprocess.check_call(["sudo", "locale-gen", locale]) + + +def main(): + options = parse_args(sys.argv[1:]) + check_lsb_release() + check_distro(options) + check_architecture() + quick_check(options) + check_root() + apt_update(options) + install_packages(options) + install_chromeos_fonts(options) + install_locales() + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/src/build/install-build-deps.sh b/src/build/install-build-deps.sh deleted file mode 100755 index a9560fb6..00000000 --- a/src/build/install-build-deps.sh +++ /dev/null @@ -1,828 +0,0 @@ -#!/bin/bash -e - -# Copyright 2023 The Chromium Authors and Alex313031 -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Script to install everything needed to build chromium (well, ideally, anyway) -# including items requiring sudo privileges. -# See https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md -# and https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_build_instructions.md - -usage() { - echo "Usage: $0 [--options]" - echo "Options:" - echo "--[no-]syms: enable or disable installation of debugging symbols" - echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot" - echo "--[no-]android: enable or disable installation of android dependencies" - echo "--[no-]arm: enable or disable installation of arm cross toolchain" - echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ - "fonts" - echo "--[no-]nacl: enable or disable installation of prerequisites for"\ - "building standalone NaCl and all its toolchains" - echo "--[no-]backwards-compatible: enable or disable installation of packages - that are no longer currently needed and have been removed from this - script. Useful for bisection." - echo "--no-prompt: silently select standard options/defaults" - echo "--quick-check: quickly try to determine if dependencies are installed" - echo " (this avoids interactive prompts and sudo commands," - echo " so might not be 100% accurate)" - echo "--unsupported: attempt installation even on unsupported systems" - echo "Script will prompt interactively if options not given." - exit 1 -} - -# Build list of apt packages in dpkg --get-selections format. -build_apt_package_list() { - echo "Building apt package list." >&2 - apt-cache dumpavail | \ - python3 -c 'import re,sys; \ -o = sys.stdin.read(); \ -p = {"i386": ":i386"}; \ -f = re.M | re.S; \ -r = re.compile(r"^Package: (.+?)$.+?^Architecture: (.+?)$", f); \ -m = ["%s%s" % (x, p.get(y, "")) for x, y in re.findall(r, o)]; \ -print("\n".join(m))' -} - -# Checks whether a particular package is available in the repos. -# Uses pre-formatted ${apt_package_list}. -# USAGE: $ package_exists -package_exists() { - if [ -z "${apt_package_list}" ]; then - echo "Call build_apt_package_list() prior to calling package_exists()" >&2 - apt_package_list=$(build_apt_package_list) - fi - # `grep` takes a regex string, so the +'s in package names, e.g. "libstdc++", - # need to be escaped. - local escaped="$(echo $1 | sed 's/[\~\+\.\:-]/\\&/g')" - [ ! -z "$(grep "^${escaped}$" <<< "${apt_package_list}")" ] -} - -do_inst_arm=0 -do_inst_nacl=0 -do_inst_android=0 - -while [ "$1" != "" ] -do - case "$1" in - --syms) do_inst_syms=1;; - --no-syms) do_inst_syms=0;; - --lib32) do_inst_lib32=1;; - --android) do_inst_android=1;; - --no-android) do_inst_android=0;; - --arm) do_inst_arm=1;; - --no-arm) do_inst_arm=0;; - --chromeos-fonts) do_inst_chromeos_fonts=1;; - --no-chromeos-fonts) do_inst_chromeos_fonts=0;; - --nacl) do_inst_nacl=1;; - --no-nacl) do_inst_nacl=0;; - --backwards-compatible) do_inst_backwards_compatible=1;; - --no-backwards-compatible) do_inst_backwards_compatible=0;; - --add-cross-tool-repo) add_cross_tool_repo=1;; - --no-prompt) do_default=1 - do_quietly="-qq --assume-yes" - ;; - --quick-check) do_quick_check=1;; - --unsupported) do_unsupported=1;; - *) usage;; - esac - shift -done - -if [ "$do_inst_arm" = "1" ]; then - do_inst_lib32=1 -fi - -if [ "$do_inst_android" = "1" ]; then - do_inst_lib32=1 -fi - -# Check for lsb_release command in $PATH -if ! which lsb_release > /dev/null; then - echo "ERROR: lsb_release not found in \$PATH" >&2 - echo "try: sudo apt-get install lsb-release" >&2 - exit 1; -fi - -distro_codename=$(lsb_release --codename --short) -distro_id=$(lsb_release --id --short) -supported_codenames="(bionic|focal|jammy|kinetic|lunar)" -supported_ids="(Debian)" -if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then - if [[ ! $distro_codename =~ $supported_codenames && - ! $distro_id =~ $supported_ids ]]; then - echo -e "WARNING: The following distributions are supported, - but distributions not in the list below can also try to install - dependencies by passing the `--unsupported` parameter\n" \ - "\tUbuntu 18.04 LTS (bionic with EoL April 2028)\n" \ - "\tUbuntu 20.04 LTS (focal with EoL April 2030)\n" \ - "\tUbuntu 22.04 LTS (jammy with EoL April 2032)\n" \ - "\tUbuntu 22.10 (kinetic with EoL October 2023)\n" \ - "\tUbuntu 23.04 (lunar with EoL April 2024)\n" \ - "\tDebian 10 (buster) or later" >&2 - exit 1 - fi - -# Check system architecture - if ! uname -m | egrep -q "i686|x86_64"; then - echo "Only x86 architectures are currently supported" >&2 - exit - fi -fi - -if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then - echo "Running as non-root user." - echo "You might have to enter your password one or more times for 'sudo'." - echo -fi - -if [ 0 -eq "${do_quick_check-0}" ] ; then - if [ "$do_inst_lib32" = "1" ] || [ "$do_inst_nacl" = "1" ]; then - sudo dpkg --add-architecture i386 - fi - sudo apt-get update -fi - -# Populate ${apt_package_list} for package_exists() parsing. -apt_package_list=$(build_apt_package_list) - -# Packages needed for chromeos only -chromeos_dev_list="libbluetooth-dev libxkbcommon-dev mesa-common-dev zstd" - -if package_exists realpath; then - chromeos_dev_list="${chromeos_dev_list} realpath" -fi - -# Packages needed for development -dev_list="\ - binutils - bison - bzip2 - cdbs - curl - dbus-x11 - dpkg-dev - elfutils - devscripts - fakeroot - flex - git-core - gperf - icoutils - libasound2-dev - libatspi2.0-dev - libbrlapi-dev - libbz2-dev - libcairo2-dev - libcap-dev - libc6-dev - libcups2-dev - libcurl4-gnutls-dev - libdrm-dev - libelf-dev - libevdev-dev - libffi-dev - libgbm-dev - libglib2.0-dev - libglu1-mesa-dev - libgtk-3-dev - libkrb5-dev - libnspr4-dev - libnss3-dev - libpam0g-dev - libpci-dev - libpulse-dev - libsctp-dev - libspeechd-dev - libsqlite3-dev - libssl-dev - libsystemd-dev - libudev-dev - libva-dev - libwww-perl - libxshmfence-dev - libxslt1-dev - libxss-dev - libxt-dev - libxtst-dev - lighttpd - locales - openbox - p7zip - patch - perl - pkg-config - rpm - ruby - subversion - uuid-dev - wdiff - wget - x11-utils - xcompmgr - xz-utils - zip - $chromeos_dev_list -" - -# 64-bit systems need a minimum set of 32-bit compat packages for the pre-built -# NaCl binaries. -if file -L /sbin/init | grep -q 'ELF 64-bit'; then - dev_list="${dev_list} libc6-i386 lib32stdc++6" - - # lib32gcc-s1 used to be called lib32gcc1 in older distros. - if package_exists lib32gcc-s1; then - dev_list="${dev_list} lib32gcc-s1" - elif package_exists lib32gcc1; then - dev_list="${dev_list} lib32gcc1" - fi -fi - -# Run-time libraries required by chromeos only -chromeos_lib_list="libpulse0 libbz2-1.0" - -# List of required run-time libraries -common_lib_list="\ - lib32z1 - libasound2 - libatk1.0-0 - libatspi2.0-0 - libc6 - libcairo2 - libcap2 - libcgi-session-perl - libcups2 - libdrm2 - libegl1 - libevdev2 - libexpat1 - libfontconfig1 - libfreetype6 - libgbm1 - libglib2.0-0 - libgl1 - libgtk-3-0 - libncurses5 - libpam0g - libpango-1.0-0 - libpangocairo-1.0-0 - libpci3 - libpcre3 - libpixman-1-0 - libspeechd2 - libstdc++6 - libsqlite3-0 - libuuid1 - libwayland-egl1 - libwayland-egl1-mesa - libx11-6 - libx11-xcb1 - libxau6 - libxcb1 - libxcomposite1 - libxcursor1 - libxdamage1 - libxdmcp6 - libxext6 - libxfixes3 - libxi6 - libxinerama1 - libxrandr2 - libxrender1 - libxtst6 - x11-utils - xvfb - zlib1g -" - -if package_exists libffi8; then - common_lib_list="${common_lib_list} libffi8" -elif package_exists libffi7; then - common_lib_list="${common_lib_list} libffi7" -elif package_exists libffi6; then - common_lib_list="${common_lib_list} libffi6" -fi - -# Full list of required run-time libraries -lib_list="\ - $common_lib_list - $chromeos_lib_list -" - -# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf -lib32_list="linux-libc-dev-i386-cross libpci3:i386" - -# 32-bit libraries needed for a 32-bit build -# includes some 32-bit libraries required by the Android SDK -# See https://developer.android.com/sdk/installing/index.html?pkg=tools -lib32_list="$lib32_list - libasound2:i386 - libatk-bridge2.0-0:i386 - libatk1.0-0:i386 - libatspi2.0-0:i386 - libdbus-1-3:i386 - libegl1:i386 - libgl1:i386 - libglib2.0-0:i386 - libncurses5:i386 - libnss3:i386 - libpango-1.0-0:i386 - libpangocairo-1.0-0:i386 - libstdc++6:i386 - libwayland-egl1:i386 - libx11-xcb1:i386 - libxcomposite1:i386 - libxdamage1:i386 - libxkbcommon0:i386 - libxrandr2:i386 - libxtst6:i386 - zlib1g:i386 -" - -# Packages that have been removed from this script. Regardless of configuration -# or options passed to this script, whenever a package is removed, it should be -# added here. -backwards_compatible_list="\ - 7za - fonts-indic - fonts-ipafont - fonts-stix - fonts-thai-tlwg - fonts-tlwg-garuda - g++ - g++-4.8-multilib-arm-linux-gnueabihf - gcc-4.8-multilib-arm-linux-gnueabihf - g++-9-multilib-arm-linux-gnueabihf - gcc-9-multilib-arm-linux-gnueabihf - gcc-arm-linux-gnueabihf - g++-10-multilib-arm-linux-gnueabihf - gcc-10-multilib-arm-linux-gnueabihf - g++-10-arm-linux-gnueabihf - gcc-10-arm-linux-gnueabihf - git-svn - language-pack-da - language-pack-fr - language-pack-he - language-pack-zh-hant - libappindicator-dev - libappindicator1 - libappindicator3-1 - libappindicator3-dev - libdconf-dev - libdconf1 - libdconf1:i386 - libexif-dev - libexif12 - libexif12:i386 - libgbm-dev - libgbm-dev-lts-trusty - libgbm-dev-lts-xenial - libgconf-2-4:i386 - libgconf2-dev - libgl1-mesa-dev - libgl1-mesa-dev-lts-trusty - libgl1-mesa-dev-lts-xenial - libgl1-mesa-glx:i386 - libgl1-mesa-glx-lts-trusty:i386 - libgl1-mesa-glx-lts-xenial:i386 - libgles2-mesa-dev - libgles2-mesa-dev-lts-trusty - libgles2-mesa-dev-lts-xenial - libgtk-3-0:i386 - libgtk2.0-0 - libgtk2.0-0:i386 - libgtk2.0-dev - mesa-common-dev - mesa-common-dev-lts-trusty - mesa-common-dev-lts-xenial - msttcorefonts - python-dev - python-setuptools - ttf-dejavu-core - ttf-indic-fonts - ttf-kochi-gothic - ttf-kochi-mincho - ttf-mscorefonts-installer - xfonts-mathml -" - -if package_exists python-is-python2; then - backwards_compatible_list="${backwards_compatible_list} python-is-python2 python2-dev" -else - backwards_compatible_list="${backwards_compatible_list} python" -fi - -if package_exists python-crypto; then - backwards_compatible_list="${backwards_compatible_list} python-crypto" -fi - -if package_exists python-numpy; then - backwards_compatible_list="${backwards_compatible_list} python-numpy" -fi - -if package_exists python-openssl; then - backwards_compatible_list="${backwards_compatible_list} python-openssl" -fi - -if package_exists python-psutil; then - backwards_compatible_list="${backwards_compatible_list} python-psutil" -fi - -if package_exists python-yaml; then - backwards_compatible_list="${backwards_compatible_list} python-yaml" -fi -if package_exists apache2.2-bin; then - backwards_compatible_list="${backwards_compatible_list} apache2.2-bin" -else - backwards_compatible_list="${backwards_compatible_list} apache2-bin" -fi -if package_exists php8.1-cgi; then - backwards_compatible_list="${backwards_compatible_list} php8.1-cgi libapache2-mod-php8.1" -elif package_exists php8.0-cgi; then - backwards_compatible_list="${backwards_compatible_list} php8.0-cgi libapache2-mod-php8.0" -elif package_exists php7.4-cgi; then - backwards_compatible_list="${backwards_compatible_list} php7.4-cgi libapache2-mod-php7.4" -elif package_exists php7.3-cgi; then - backwards_compatible_list="${backwards_compatible_list} php7.3-cgi libapache2-mod-php7.3" -elif package_exists php7.2-cgi; then - backwards_compatible_list="${backwards_compatible_list} php7.2-cgi libapache2-mod-php7.2" -elif package_exists php7.1-cgi; then - backwards_compatible_list="${backwards_compatible_list} php7.1-cgi libapache2-mod-php7.1" -elif package_exists php7.0-cgi; then - backwards_compatible_list="${backwards_compatible_list} php7.0-cgi libapache2-mod-php7.0" -elif package_exists php8.0-cgi; then - backwards_compatible_list="${backwards_compatible_list} php8.0-cgi libapache2-mod-php8.0" -else - backwards_compatible_list="${backwards_compatible_list} php5-cgi libapache2-mod-php5" -fi - -# arm cross toolchain packages needed to build chrome on armhf -arm_list="libc6-dev-armhf-cross - libc6-dev-arm64-cross - linux-libc-dev-armhf-cross - linux-libc-dev-arm64-cross - g++-arm-linux-gnueabihf" - -# Work around for dependency issue Ubuntu: http://crbug.com/435056 -case $distro_codename in - bionic) - arm_list+=" g++-5-multilib-arm-linux-gnueabihf - gcc-5-multilib-arm-linux-gnueabihf - gcc-arm-linux-gnueabihf" - ;; - focal) - arm_list+=" g++-10-multilib-arm-linux-gnueabihf - gcc-10-multilib-arm-linux-gnueabihf - gcc-arm-linux-gnueabihf" - ;; - jammy) - arm_list+=" gcc-arm-linux-gnueabihf - g++-11-arm-linux-gnueabihf - gcc-11-arm-linux-gnueabihf" - ;; - kinetic) - arm_list+=" gcc-arm-linux-gnueabihf - g++-11-arm-linux-gnueabihf - gcc-11-arm-linux-gnueabihf" - ;; - lunar) - arm_list+=" gcc-arm-linux-gnueabihf - g++-11-arm-linux-gnueabihf - gcc-11-arm-linux-gnueabihf" - ;; -esac - -# Packages to build NaCl, its toolchains, and its ports. -naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc" -nacl_list="\ - g++-mingw-w64-i686 - lib32z1-dev - libasound2:i386 - libcap2:i386 - libelf-dev:i386 - libfontconfig1:i386 - libglib2.0-0:i386 - libgpm2:i386 - libncurses5:i386 - lib32ncurses5-dev - libnss3:i386 - libpango-1.0-0:i386 - libssl-dev:i386 - libtinfo-dev - libtinfo-dev:i386 - libtool - libuuid1:i386 - libxcomposite1:i386 - libxcursor1:i386 - libxdamage1:i386 - libxi6:i386 - libxrandr2:i386 - libxss1:i386 - libxtst6:i386 - texinfo - xvfb - ${naclports_list} -" - -# Some package names have changed over time -if package_exists libssl-dev; then - nacl_list="${nacl_list} libssl-dev:i386" -elif package_exists libssl1.1; then - nacl_list="${nacl_list} libssl1.1:i386" -elif package_exists libssl1.0.2; then - nacl_list="${nacl_list} libssl1.0.2:i386" -else - nacl_list="${nacl_list} libssl1.0.0:i386" -fi -if package_exists libtinfo5; then - nacl_list="${nacl_list} libtinfo5" -fi -if package_exists libpng16-16; then - lib_list="${lib_list} libpng16-16" -else - lib_list="${lib_list} libpng12-0" -fi -if package_exists libnspr4; then - lib_list="${lib_list} libnspr4 libnss3" -else - lib_list="${lib_list} libnspr4-0d libnss3-1d" -fi -if package_exists libjpeg-dev; then - dev_list="${dev_list} libjpeg-dev" -else - dev_list="${dev_list} libjpeg62-dev" -fi -if package_exists libudev1; then - dev_list="${dev_list} libudev1" - nacl_list="${nacl_list} libudev1:i386" -else - dev_list="${dev_list} libudev0" - nacl_list="${nacl_list} libudev0:i386" -fi -if package_exists libbrlapi0.8; then - dev_list="${dev_list} libbrlapi0.8" -elif package_exists libbrlapi0.7; then - dev_list="${dev_list} libbrlapi0.7" -elif package_exists libbrlapi0.6; then - dev_list="${dev_list} libbrlapi0.6" -else - dev_list="${dev_list} libbrlapi0.5" -fi -if package_exists libav-tools; then - dev_list="${dev_list} libav-tools" -fi - -# Some packages are only needed if the distribution actually supports -# installing them. -if package_exists appmenu-gtk; then - lib_list="$lib_list appmenu-gtk" -fi -if package_exists libgnome-keyring0; then - lib_list="${lib_list} libgnome-keyring0" -fi -if package_exists libgnome-keyring-dev; then - lib_list="${lib_list} libgnome-keyring-dev" -fi -if package_exists libvulkan-dev; then - dev_list="${dev_list} libvulkan-dev" -fi -if package_exists libvulkan1; then - lib_list="${lib_list} libvulkan1" -fi -if package_exists libinput10; then - lib_list="${lib_list} libinput10" -fi -if package_exists libinput-dev; then - dev_list="${dev_list} libinput-dev" -fi - -# Cross-toolchain strip is needed for building the sysroots. -if package_exists binutils-arm-linux-gnueabihf; then - dev_list="${dev_list} binutils-arm-linux-gnueabihf" -fi -if package_exists binutils-aarch64-linux-gnu; then - dev_list="${dev_list} binutils-aarch64-linux-gnu" -fi -if package_exists binutils-mipsel-linux-gnu; then - dev_list="${dev_list} binutils-mipsel-linux-gnu" -fi -if package_exists binutils-mips64el-linux-gnuabi64; then - dev_list="${dev_list} binutils-mips64el-linux-gnuabi64" -fi - -# When cross building for arm/Android on 64-bit systems the host binaries -# that are part of v8 need to be compiled with -m32 which means -# that basic multilib support is needed. -if file -L /sbin/init | grep -q 'ELF 64-bit'; then - # gcc-multilib conflicts with the arm cross compiler but - # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the - # appropriate value of X and Y by seeing what version the current - # distribution's g++-multilib package depends on. - multilib_package=$(apt-cache depends g++-multilib --important | \ - grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b') - lib32_list="$lib32_list $multilib_package" -fi - -if [ "$do_inst_syms" = "1" ]; then - echo "Including debugging symbols." - - # Debian is in the process of transitioning to automatic debug packages, which - # have the -dbgsym suffix (https://wiki.debian.org/AutomaticDebugPackages). - # Untransitioned packages have the -dbg suffix. And on some systems, neither - # will be available, so exclude the ones that are missing. - dbg_package_name() { - if package_exists "$1-dbgsym"; then - echo "$1-dbgsym" - elif package_exists "$1-dbg"; then - echo "$1-dbg" - fi - } - - for package in "${common_lib_list}"; do - dbg_list="$dbg_list $(dbg_package_name ${package})" - done - - # Debugging symbols packages not following common naming scheme - if [ "$(dbg_package_name libstdc++6)" == "" ]; then - if package_exists libstdc++6-8-dbg; then - dbg_list="${dbg_list} libstdc++6-8-dbg" - elif package_exists libstdc++6-7-dbg; then - dbg_list="${dbg_list} libstdc++6-7-dbg" - elif package_exists libstdc++6-6-dbg; then - dbg_list="${dbg_list} libstdc++6-6-dbg" - elif package_exists libstdc++6-5-dbg; then - dbg_list="${dbg_list} libstdc++6-5-dbg" - elif package_exists libstdc++6-4.9-dbg; then - dbg_list="${dbg_list} libstdc++6-4.9-dbg" - elif package_exists libstdc++6-4.8-dbg; then - dbg_list="${dbg_list} libstdc++6-4.8-dbg" - elif package_exists libstdc++6-4.7-dbg; then - dbg_list="${dbg_list} libstdc++6-4.7-dbg" - elif package_exists libstdc++6-4.6-dbg; then - dbg_list="${dbg_list} libstdc++6-4.6-dbg" - fi - fi - if [ "$(dbg_package_name libatk1.0-0)" == "" ]; then - dbg_list="$dbg_list $(dbg_package_name libatk1.0)" - fi - if [ "$(dbg_package_name libpango-1.0-0)" == "" ]; then - dbg_list="$dbg_list $(dbg_package_name libpango1.0-dev)" - fi -else - echo "Skipping debugging symbols." - dbg_list= -fi - -if [ "$do_inst_lib32" = "1" ]; then - echo "Including 32-bit libraries." -else - echo "Skipping 32-bit libraries." - lib32_list= -fi - -if [ "$do_inst_android" = "1" ]; then - echo "Including Android dependencies." -else - echo "Skipping Android dependencies." -fi - -if [ "$do_inst_arm" = "1" ]; then - echo "Including ARM cross toolchain." -else - echo "Skipping ARM cross toolchain." - arm_list= -fi - -if [ "$do_inst_nacl" = "1" ]; then - echo "Including NaCl, NaCl toolchain, NaCl ports dependencies." -else - echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies." - nacl_list= -fi - -filtered_backwards_compatible_list= -if [ "$do_inst_backwards_compatible" = "1" ]; then - echo "Including backwards compatible packages." - for package in ${backwards_compatible_list}; do - if package_exists ${package}; then - filtered_backwards_compatible_list+=" ${package}" - fi - done -fi - -# The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid -# confusing dpkg-query (crbug.com/446172). -packages="$( - echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}" \ - "${nacl_list}" ${filtered_backwards_compatible_list} | tr " " "\n" | \ - sort -u | sort -r -s -t: -k2 | tr "\n" " " -)" - -if [ 1 -eq "${do_quick_check-0}" ] ; then - if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then - # Distinguish between packages that actually aren't available to the - # system (i.e. not in any repo) and packages that just aren't known to - # dpkg (i.e. managed by apt). - missing_packages="$(echo "${missing_packages}" | awk '{print $NF}')" - not_installed="" - unknown="" - for p in ${missing_packages}; do - if apt-cache show ${p} > /dev/null 2>&1; then - not_installed="${p}\n${not_installed}" - else - unknown="${p}\n${unknown}" - fi - done - if [ -n "${not_installed}" ]; then - echo "WARNING: The following packages are not installed:" - echo -e "${not_installed}" | sed -e "s/^/ /" - fi - if [ -n "${unknown}" ]; then - echo "WARNING: The following packages are unknown to your system" - echo "(maybe missing a repo or need to 'sudo apt-get update'):" - echo -e "${unknown}" | sed -e "s/^/ /" - fi - exit 1 - fi - exit 0 -fi - -echo "Finding missing packages..." -# Intentionally leaving $packages unquoted so it's more readable. -echo "Packages required: " $packages -echo -query_cmd="apt-get --just-print install $(echo $packages)" -if cmd_output="$(LANGUAGE=en LANG=C $query_cmd)"; then - new_list=$(echo "$cmd_output" | - sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d' | - sed 's/ *$//') - upgrade_list=$(echo "$cmd_output" | - sed -e '1,/The following packages will be upgraded:/d;s/^ //;t;d' | - sed 's/ *$//') - if [ -z "$new_list" ] && [ -z "$upgrade_list" ]; then - echo "No missing packages, and the packages are up to date." - else - echo "Installing and upgrading packages: $new_list $upgrade_list." - sudo apt-get install ${do_quietly-} ${new_list} ${upgrade_list} - fi - echo -else - # An apt-get exit status of 100 indicates that a real error has occurred. - - # I am intentionally leaving out the '"'s around query_cmd, - # as this makes it easier to cut and paste the output - echo "The following command failed: " ${query_cmd} - echo - echo "It produced the following output:" - echo "$cmd_output" - echo - echo "You will have to install the above packages yourself." - echo - exit 100 -fi - -# Install the Chrome OS default fonts. This must go after running -# apt-get, since install-chromeos-fonts depends on curl. -if [ "$do_inst_chromeos_fonts" != "0" ]; then - echo - echo "Installing Chrome OS fonts." - dir=`echo $0 | sed -r -e 's/\/[^/]+$//'` - if ! sudo $dir/linux/install-chromeos-fonts.py; then - echo "ERROR: The installation of the Chrome OS default fonts failed." - if [ `stat -f -c %T $dir` == "nfs" ]; then - echo "The reason is that your repo is installed on a remote file system." - else - echo "This is expected if your repo is installed on a remote file system." - fi - echo "It is recommended to install your repo on a local file system." - echo "You can skip the installation of the Chrome OS default fonts with" - echo "the command line option: --no-chromeos-fonts." - exit 1 - fi -else - echo "Skipping installation of Chrome OS fonts." -fi - -echo "Installing locales." -CHROMIUM_LOCALES="da_DK.UTF-8 fr_FR.UTF-8 he_IL.UTF-8 zh_TW.UTF-8" -LOCALE_GEN=/etc/locale.gen -if [ -e ${LOCALE_GEN} ]; then - OLD_LOCALE_GEN="$(cat /etc/locale.gen)" - for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do - sudo sed -i "s/^# ${CHROMIUM_LOCALE}/${CHROMIUM_LOCALE}/" ${LOCALE_GEN} - done - # Regenerating locales can take a while, so only do it if we need to. - if (echo "${OLD_LOCALE_GEN}" | cmp -s ${LOCALE_GEN}); then - echo "Locales already up-to-date." - else - sudo locale-gen - fi -else - for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do - sudo locale-gen ${CHROMIUM_LOCALE} - done -fi - -sudo snap install --classic snapcraft -sudo snap install --classic multipass diff --git a/src/chrome/android/BUILD.gn b/src/chrome/android/BUILD.gn index 5dbaeb2b..162a6b24 100644 --- a/src/chrome/android/BUILD.gn +++ b/src/chrome/android/BUILD.gn @@ -58,6 +58,72 @@ if (current_toolchain == default_toolchain) { app_hooks_impl = "java/src/org/chromium/chrome/browser/AppHooksImpl.java" + template("chrome_public_bundle") { + _is_monochrome = defined(invoker.is_monochrome) && invoker.is_monochrome + if (_is_monochrome) { + _module_descs = monochrome_module_descs + } else { + _module_descs = chrome_module_descs + } + + _base_module_target_name = "${invoker.target_name}__base_bundle_module" + chrome_public_apk_or_module_tmpl(_base_module_target_name) { + forward_variables_from(invoker, + [ + "add_view_trace_events", + "expected_android_manifest", + "is_64_bit_browser", + "is_monochrome", + "is_trichrome", + "include_32_bit_webview", + "include_64_bit_webview", + "static_library_provider", + "resource_ids_provider_dep", + ]) + target_type = "android_app_bundle_module" + + srcjar_deps = [] + foreach(_module_desc, _module_descs) { + if (defined(_module_desc.jni_registration)) { + srcjar_deps += [ _module_desc.jni_registration ] + } + } + + if (defined(invoker.expected_android_manifest_template)) { + expected_android_manifest = + string_replace(invoker.expected_android_manifest_template, + "SPLIT_NAME", + "base") + } + } + + chrome_bundle(target_name) { + forward_variables_from(invoker, + [ + "add_view_trace_events", + "baseline_profile_path", + "bundle_name", + "enable_lint", + "include_32_bit_webview", + "include_64_bit_webview", + "is_64_bit_browser", + "is_monochrome", + "is_trichrome", + "lint_baseline_file", + "lint_min_sdk_version", + "lint_suppressions_file", + "static_library_provider", + "expected_android_manifest_template", + "expected_libs_and_assets", + "expected_proguard_config", + ]) + base_module_target = ":$_base_module_target_name" + manifest_package = chrome_public_manifest_package + module_descs = _module_descs + chrome_deps = [ ":delegate_public_impl_java" ] + } + } + jinja_template("chrome_public_android_feature_vr_manifest") { input = "features/vr/java/AndroidManifest.xml" output = feature_module_vr_android_manifest_path @@ -217,7 +283,7 @@ if (current_toolchain == default_toolchain) { "//chrome/android/webapk/libs/common:splash_java", "//chrome/android/webapk/libs/runtime_library:webapk_service_aidl_java", "//chrome/browser/accessibility/hierarchysnapshotter/android:java", - "//chrome/browser/android/browserservices/constants:java", + "//chrome/browser/android/auxiliary_search/proto:proto_java", "//chrome/browser/android/browserservices/intents:java", "//chrome/browser/android/browserservices/metrics:java", "//chrome/browser/android/browserservices/verification:java", @@ -277,6 +343,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/password_entry_edit:public_java", "//chrome/browser/password_manager/android:java", "//chrome/browser/password_manager/android:settings_interface_java", + "//chrome/browser/password_manager/android/pwd_migration:java", "//chrome/browser/policy/android:java", "//chrome/browser/preferences:java", "//chrome/browser/prefetch/android:java", @@ -332,9 +399,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/user_education:java", "//chrome/browser/util:java", "//chrome/browser/version:java", - "//chrome/browser/video_tutorials:factory_java", - "//chrome/browser/video_tutorials:java", - "//chrome/browser/video_tutorials:java_resources", "//chrome/browser/webapps/android:java", "//chrome/browser/webauthn/android:java", "//chrome/browser/xsurface:java", @@ -487,7 +551,6 @@ if (current_toolchain == default_toolchain) { "//mojo/public/java/system:system_impl_java", "//mojo/public/mojom/base:base_java", "//net/android:net_java", - "//services/audio/public/java:audio_feature_list_java", "//services/data_decoder/public/cpp/android:safe_json_java", "//services/device/public/java:device_feature_list_java", "//services/device/public/mojom:mojom_java", @@ -532,7 +595,9 @@ if (current_toolchain == default_toolchain) { "//third_party/blink/public/mojom:android_mojo_bindings_java", "//third_party/blink/public/mojom:mojom_platform_java", "//third_party/gif_player:gif_player_java", + "//third_party/kotlin_stdlib:kotlin_stdlib_java", "//third_party/metrics_proto:metrics_proto_java", + "//ui/accessibility:ax_base_java", "//ui/android:ui_java", "//ui/base/ime/mojom:mojom_java", "//ui/base/mojom:mojom_java", @@ -664,7 +729,7 @@ if (current_toolchain == default_toolchain) { java_package = "org.chromium.chrome.browser" } - # This is a list of all base module java dependencies. New features should be + # This is a list of all chrome module java dependencies. New features should be # added to this list. java_group("chrome_all_java") { deps = [ @@ -681,13 +746,13 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/tabmodel/internal:java", "//chrome/browser/touch_to_fill/android/internal:java", "//chrome/browser/touch_to_fill/common/android:java", + "//chrome/browser/touch_to_fill/password_generation/android/internal:java", "//chrome/browser/touch_to_fill/payments/android/internal:java", "//chrome/browser/ui/android/appmenu/internal:java", "//chrome/browser/ui/android/autofill/internal:java", "//chrome/browser/ui/android/edge_to_edge/internal:java", "//chrome/browser/ui/android/fast_checkout/internal:java", "//chrome/browser/ui/android/webid/internal:java", - "//chrome/browser/video_tutorials/internal:java", "//components/browser_ui/bottomsheet/android/internal:java", "//components/messages/android/internal:java", "//components/segmentation_platform/internal:internal_java", @@ -803,7 +868,7 @@ if (current_toolchain == default_toolchain) { "//chrome/android/webapk/libs/common:common_java", "//chrome/android/webapk/libs/common:splash_java", "//chrome/android/webapk/test:junit_test_support", - "//chrome/browser/android/browserservices/constants:java", + "//chrome/browser/android/auxiliary_search/proto:proto_java", "//chrome/browser/android/browserservices/intents:java", "//chrome/browser/android/browserservices/intents:junit", "//chrome/browser/android/browserservices/metrics:java", @@ -862,6 +927,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/omaha/android:java", "//chrome/browser/optimization_guide/android:java", "//chrome/browser/partnercustomizations:java", + "//chrome/browser/partnercustomizations:junit", "//chrome/browser/password_edit_dialog/android:junit", "//chrome/browser/password_entry_edit/android/internal:junit", "//chrome/browser/password_manager/android:java", @@ -939,14 +1005,11 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/util:java", "//chrome/browser/util:junit_tests", "//chrome/browser/version:java", - "//chrome/browser/video_tutorials:factory_java", - "//chrome/browser/video_tutorials:java", - "//chrome/browser/video_tutorials:test_support_java", - "//chrome/browser/video_tutorials/internal:junit", "//chrome/browser/webapps/android:java", "//chrome/browser/xsurface:java", "//chrome/test:sync_integration_test_support_java", "//chrome/test/android:chrome_java_unit_test_support", + "//components/autofill/android:autofill_features_java", "//components/autofill/android:main_autofill_java", "//components/autofill/android:prefeditor_autofill_java", "//components/background_task_scheduler:background_task_scheduler_java", @@ -969,6 +1032,7 @@ if (current_toolchain == default_toolchain) { "//components/browser_ui/util/android:java", "//components/browser_ui/widget/android:java", "//components/browser_ui/widget/android:test_support_java", + "//components/browsing_data/core:java", "//components/commerce/core:proto_java", "//components/commerce/core/android:core_java", "//components/content_capture/android:java", @@ -1029,6 +1093,8 @@ if (current_toolchain == default_toolchain) { "//components/webapk/android/libs/client:java", "//components/webapk/android/libs/common:java", "//components/webapps/browser/android:java", + "//components/webauthn/android:java", + "//components/webauthn/android:test_support_java", "//content/public/android:content_java", "//content/public/common:common_java", "//content/public/test/android:content_java_test_support", @@ -1036,6 +1102,7 @@ if (current_toolchain == default_toolchain) { "//mojo/public/java:system_java", "//mojo/public/mojom/base:base_java", "//net/android:net_java", + "//services/device/public/java:device_feature_list_java", "//services/device/public/mojom:mojom_java", "//services/media_session/public/cpp/android:media_session_java", "//services/media_session/public/mojom:mojom_java", @@ -1075,6 +1142,7 @@ if (current_toolchain == default_toolchain) { "//url:gurl_junit_tests", "//url:origin_java", "//url/mojom:url_mojom_gurl_java", + "//url/mojom:url_mojom_origin_java", ] deps += chrome_junit_test_java_deps @@ -1113,6 +1181,7 @@ if (current_toolchain == default_toolchain) { "//content/public/test/android:content_java_test_support", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/androidx:androidx_browser_browser_java", + "//third_party/androidx:androidx_test_core_java", "//third_party/androidx:androidx_test_monitor_java", "//third_party/junit:junit", "//url:gurl_java", @@ -1333,6 +1402,12 @@ if (current_toolchain == default_toolchain) { data = [ "//chrome/test/data/android/" ] } + flatbuffer_java_library( + "critical_persisted_tab_data_flatbuffer_test_v1_java") { + root_dir = "javatests/src/org/chromium/chrome/browser/tab/state/" + sources = [ "$root_dir/critical_persisted_tab_data_test_v1.fbs" ] + } + android_library("chrome_test_java") { testonly = true resources_package = "org.chromium.chrome.test" @@ -1340,11 +1415,15 @@ if (current_toolchain == default_toolchain) { # From java_sources.gni. sources = chrome_test_java_sources + mergeable_android_manifests = + [ "javatests/AndroidManifest_ChromeTests.xml" ] + deps = [ ":base_module_java", ":browser_java_test_support", ":chrome_app_java_resources", ":chrome_test_util_java", + ":critical_persisted_tab_data_flatbuffer_test_v1_java", ":delegate_public_impl_java", "$google_play_services_package:google_play_services_base_java", "$google_play_services_package:google_play_services_basement_java", @@ -1371,7 +1450,6 @@ if (current_toolchain == default_toolchain) { "//chrome/android/webapk/libs/client:client_java", "//chrome/android/webapk/libs/common:common_java", "//chrome/android/webapk/libs/runtime_library:webapk_service_aidl_java", - "//chrome/browser/android/browserservices/constants:java", "//chrome/browser/android/browserservices/intents:java", "//chrome/browser/android/browserservices/verification:java", "//chrome/browser/android/browserservices/verification:javatests", @@ -1494,7 +1572,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/ui/messages/android:java", "//chrome/browser/uid/android:java", "//chrome/browser/util:java", - "//chrome/browser/video_tutorials:test_support_java", "//chrome/browser/webapps/android:java", "//chrome/test:sync_integration_test_support_java", "//chrome/test:test_support_java", @@ -1668,11 +1745,13 @@ if (current_toolchain == default_toolchain) { "//third_party/junit", "//third_party/metrics_proto:metrics_proto_java", "//third_party/mockito:mockito_java", + "//ui/accessibility:ax_base_java", "//ui/android:clipboard_java_test_support", "//ui/android:ui_java", "//ui/android:ui_java_test_support", "//ui/base/ime/mojom:mojom_java", "//ui/base/mojom:mojom_java", + "//url:android_test_helper_java", "//url:gurl_java", "//url:gurl_junit_test_support", "//url:origin_java", @@ -1752,7 +1831,6 @@ if (current_toolchain == default_toolchain) { "//base:base_java_test_support", "//chrome/android:chrome_java", "//chrome/android:delegate_public_impl_java", - "//chrome/android/features/vr:java", "//chrome/browser/flags:java", "//chrome/browser/tab:java", "//chrome/browser/tabmodel:java", @@ -1767,6 +1845,7 @@ if (current_toolchain == default_toolchain) { "//net/android:net_java_test_support", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/androidx:androidx_browser_browser_java", + "//third_party/androidx:androidx_test_core_java", "//third_party/androidx:androidx_test_monitor_java", "//third_party/androidx:androidx_test_rules_java", "//third_party/androidx:androidx_test_runner_java", @@ -1775,6 +1854,10 @@ if (current_toolchain == default_toolchain) { "//ui/android:ui_java", ] + if (enable_gvr_services) { + chrome_test_xr_java_deps += [ "//chrome/android/features/vr:java" ] + } + # Files used for both VR and AR testing android_library("chrome_test_xr_java") { testonly = true @@ -1810,29 +1893,10 @@ if (current_toolchain == default_toolchain) { resources_package = "org.chromium.chrome.vr" sources = [ - "javatests/src/org/chromium/chrome/browser/vr/EmulatedVrController.java", - "javatests/src/org/chromium/chrome/browser/vr/TestVrShellDelegate.java", - "javatests/src/org/chromium/chrome/browser/vr/VrDaydreamReadyModuleInstallTest.java", - "javatests/src/org/chromium/chrome/browser/vr/VrInstallUpdateMessageTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrDeviceTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrInputTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTestFramework.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTabTest.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTestFramework.java", - "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTransitionTest.java", - "javatests/src/org/chromium/chrome/browser/vr/mock/MockVrCoreVersionChecker.java", - "javatests/src/org/chromium/chrome/browser/vr/mock/MockVrDaydreamApi.java", - "javatests/src/org/chromium/chrome/browser/vr/rules/ChromeTabbedActivityVrTestRule.java", - "javatests/src/org/chromium/chrome/browser/vr/rules/CustomTabActivityVrTestRule.java", "javatests/src/org/chromium/chrome/browser/vr/rules/VrModuleNotInstalled.java", "javatests/src/org/chromium/chrome/browser/vr/rules/VrTestRule.java", - "javatests/src/org/chromium/chrome/browser/vr/rules/WebappActivityVrTestRule.java", "javatests/src/org/chromium/chrome/browser/vr/util/NativeUiUtils.java", "javatests/src/org/chromium/chrome/browser/vr/util/VrMessageUtils.java", - "javatests/src/org/chromium/chrome/browser/vr/util/VrShellDelegateUtils.java", - "javatests/src/org/chromium/chrome/browser/vr/util/VrTestRuleUtils.java", - "javatests/src/org/chromium/chrome/browser/vr/util/VrTransitionUtils.java", ] deps = chrome_test_xr_java_deps + [ @@ -1850,11 +1914,42 @@ if (current_toolchain == default_toolchain) { "//components/messages/android/internal:java", "//components/messages/android/test:test_support_java", "//components/module_installer/android:module_installer_java", - "//third_party/gvr-android-sdk:controller_test_api_java", - "//third_party/gvr-android-sdk:gvr_common_java", + "//third_party/androidx:androidx_test_core_java", + "//third_party/androidx:androidx_test_core_java", "//ui/android:ui_java_test_support", ] + if (enable_gvr_services) { + sources += [ + "javatests/src/org/chromium/chrome/browser/vr/EmulatedVrController.java", + "javatests/src/org/chromium/chrome/browser/vr/TestVrShellDelegate.java", + "javatests/src/org/chromium/chrome/browser/vr/VrDaydreamReadyModuleInstallTest.java", + "javatests/src/org/chromium/chrome/browser/vr/VrInstallUpdateMessageTest.java", + + # TODO(https://crbug.com/1429384): Modify these tests to run on non-GVR runtimes. + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrDeviceTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrInputTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrPermissionTestFramework.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTabTest.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTestFramework.java", + "javatests/src/org/chromium/chrome/browser/vr/WebXrVrTransitionTest.java", + "javatests/src/org/chromium/chrome/browser/vr/mock/MockVrCoreVersionChecker.java", + "javatests/src/org/chromium/chrome/browser/vr/mock/MockVrDaydreamApi.java", + "javatests/src/org/chromium/chrome/browser/vr/rules/ChromeTabbedActivityVrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/rules/CustomTabActivityVrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/rules/WebappActivityVrTestRule.java", + "javatests/src/org/chromium/chrome/browser/vr/util/VrShellDelegateUtils.java", + "javatests/src/org/chromium/chrome/browser/vr/util/VrTestRuleUtils.java", + "javatests/src/org/chromium/chrome/browser/vr/util/VrTransitionUtils.java", + ] + + deps += [ + "//third_party/gvr-android-sdk:controller_test_api_java", + "//third_party/gvr-android-sdk:gvr_common_java", + ] + } + data = [ "//chrome/android/shared_preference_files/test/", "//third_party/gvr-android-sdk/test-apks/", @@ -2158,17 +2253,6 @@ if (current_toolchain == default_toolchain) { is_bundle_module = true } - # Java libraries that go into each public chrome APK and base module. The chrome - # JNI registration is generated based on this target. - # TODO(tiborg): Remove the following three groups once we have a APK / module - # target that contain exactly the grouped java libraries. - java_group("chrome_public_base_module_java") { - deps = [ - ":chrome_all_java", - ":delegate_public_impl_java", - ] - } - # Exists separately from chrome_public_base_module_java_for_test to allow # downstream to depend on test support packages without needing to depend on # delegate_public_impl_java. @@ -2191,13 +2275,12 @@ if (current_toolchain == default_toolchain) { ] } - # Similar to chrome_public_base_module_java but for Java libraries that go into - # the public chrome test APK. java_group("chrome_public_base_module_java_for_test") { testonly = true deps = [ - ":chrome_public_base_module_java", + ":chrome_all_java", ":chrome_public_base_module_java_test_support", + ":delegate_public_impl_java", ] } @@ -2279,6 +2362,10 @@ if (current_toolchain == default_toolchain) { baseline_profile_path = "//chrome/android/baseline_profiles/profile.txt" } + chrome_public_bundle("chrome_public_bundle") { + bundle_name = "ChromePublic" + } + android_library("monochrome_java") { deps = [ ":base_module_java", @@ -2533,6 +2620,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/optimization_guide/android:unit_device_javatests", "//chrome/browser/partnercustomizations:unit_device_javatests", "//chrome/browser/password_edit_dialog/android:unit_device_javatests", + "//chrome/browser/recent_tabs/internal:unit_device_javatests", "//chrome/browser/signin/services/android:unit_device_javatests", "//chrome/browser/thumbnail/generator:unit_device_javatests", "//chrome/browser/ui/android/appmenu/internal:unit_device_javatests", @@ -2541,7 +2629,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/ui/android/searchactivityutils:unit_device_javatests", "//chrome/browser/ui/android/signin:unit_device_javatests", "//chrome/browser/ui/messages/android:unit_device_javatests", - "//chrome/browser/video_tutorials/internal:unit_device_javatests", "//components/browser_ui/bottomsheet/android/internal:unit_device_javatests", "//components/browser_ui/contacts_picker/android:unit_device_javatests", "//components/browser_ui/modaldialog/android:unit_device_javatests", @@ -2592,6 +2679,7 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/engagement/android:javatests", "//chrome/browser/flags:javatests", "//chrome/browser/password_check/android:test_java", + "//chrome/browser/password_manager/android/pwd_migration:javatests", "//chrome/browser/subresource_filter:subresource_filter_javatests", "//chrome/browser/touch_to_fill/android:test_java", "//chrome/browser/touch_to_fill/payments/android/internal:javatests", @@ -2668,10 +2756,13 @@ if (current_toolchain == default_toolchain) { "javatests/src/org/chromium/chrome/test/smoke/AndroidManifest.xml" target_sdk_version = android_sdk_version testonly = true - sources = - [ "javatests/src/org/chromium/chrome/test/smoke/ChromeSmokeTest.java" ] + sources = [ + "javatests/src/org/chromium/chrome/test/smoke/ChromeTabSwitcherTest.java", + "javatests/src/org/chromium/chrome/test/smoke/utilities/FirstRunNavigator.java", + ] data = [ "javatests/src/org/chromium/chrome/test/smoke/test.html" ] deps = [ + "//base:base_java", "//base:base_java_test_support", "//chrome/test/android:chrome_java_test_pagecontroller", "//content/public/test/android:content_java_test_support", @@ -2881,65 +2972,6 @@ if (current_toolchain == default_toolchain) { ] } - template("chrome_bundle_tmpl") { - _is_monochrome = defined(invoker.is_monochrome) && invoker.is_monochrome - - _base_module_target_name = "${invoker.target_name}__base_bundle_module" - chrome_public_apk_or_module_tmpl(_base_module_target_name) { - forward_variables_from(invoker, - [ - "add_view_trace_events", - "expected_android_manifest", - "is_64_bit_browser", - "is_monochrome", - "is_trichrome", - "include_32_bit_webview", - "include_64_bit_webview", - "static_library_provider", - "resource_ids_provider_dep", - ]) - target_type = "android_app_bundle_module" - bundle_target = ":${invoker.target_name}" - - if (defined(invoker.expected_android_manifest_template)) { - expected_android_manifest = - string_replace(invoker.expected_android_manifest_template, - "SPLIT_NAME", - "base") - } - } - - chrome_bundle(target_name) { - forward_variables_from(invoker, - [ - "add_view_trace_events", - "baseline_profile_path", - "bundle_name", - "enable_lint", - "include_32_bit_webview", - "include_64_bit_webview", - "is_64_bit_browser", - "is_monochrome", - "is_trichrome", - "lint_baseline_file", - "lint_min_sdk_version", - "lint_suppressions_file", - "static_library_provider", - "expected_android_manifest_template", - "expected_libs_and_assets", - "expected_proguard_config", - ]) - base_module_target = ":$_base_module_target_name" - manifest_package = chrome_public_manifest_package - if (_is_monochrome) { - module_descs = monochrome_module_descs - } else { - module_descs = chrome_module_descs - } - chrome_deps = [ ":delegate_public_impl_java" ] - } - } - group("android_lint") { if (android_64bit_target_cpu && skip_secondary_abi_for_cq) { assert(disable_android_lint) @@ -2962,7 +2994,7 @@ if (current_toolchain == default_toolchain) { } else { # Public webview targets don't work with non-public sdks. # https://crbug.com/1000763 - chrome_bundle_tmpl("monochrome_public_bundle") { + chrome_public_bundle("monochrome_public_bundle") { is_monochrome = true bundle_name = "MonochromePublic" @@ -3004,7 +3036,7 @@ if (current_toolchain == default_toolchain) { } } - chrome_bundle_tmpl("trichrome_chrome_bundle") { + chrome_public_bundle("trichrome_chrome_bundle") { is_trichrome = true bundle_name = "TrichromeChrome" static_library_provider = ":trichrome_library_apk" @@ -3118,14 +3150,14 @@ if (current_toolchain == default_toolchain) { } if (android_64bit_target_cpu) { - chrome_bundle_tmpl("monochrome_64_public_bundle") { + chrome_public_bundle("monochrome_64_public_bundle") { is_monochrome = true bundle_name = "MonochromePublic64" is_64_bit_browser = true include_32_bit_webview = false } - chrome_bundle_tmpl("trichrome_chrome_64_bundle") { + chrome_public_bundle("trichrome_chrome_64_bundle") { is_trichrome = true bundle_name = "TrichromeChrome64" is_64_bit_browser = true @@ -3138,21 +3170,21 @@ if (current_toolchain == default_toolchain) { } if (!skip_secondary_abi_for_cq) { - chrome_bundle_tmpl("monochrome_32_public_bundle") { + chrome_public_bundle("monochrome_32_public_bundle") { is_monochrome = true bundle_name = "MonochromePublic32" is_64_bit_browser = false include_64_bit_webview = false } - chrome_bundle_tmpl("monochrome_64_32_public_bundle") { + chrome_public_bundle("monochrome_64_32_public_bundle") { is_monochrome = true bundle_name = "MonochromePublic6432" is_64_bit_browser = true include_32_bit_webview = true } - chrome_bundle_tmpl("trichrome_chrome_64_32_bundle") { + chrome_public_bundle("trichrome_chrome_64_32_bundle") { is_trichrome = true bundle_name = "TrichromeChrome6432" is_64_bit_browser = true @@ -3163,7 +3195,7 @@ if (current_toolchain == default_toolchain) { "expectations/$target_name.$target_cpu.libs_and_assets.expected" } } - chrome_bundle_tmpl("trichrome_chrome_32_bundle") { + chrome_public_bundle("trichrome_chrome_32_bundle") { is_trichrome = true bundle_name = "TrichromeChrome32" is_64_bit_browser = false @@ -3197,7 +3229,6 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/announcement/AnnouncementNotificationManager.java", "java/src/org/chromium/chrome/browser/app/send_tab_to_self/SendTabToSelfNotificationReceiver.java", "java/src/org/chromium/chrome/browser/app/tab_activity_glue/ReparentingTask.java", - "java/src/org/chromium/chrome/browser/app/video_tutorials/VideoTutorialsServiceUtils.java", "java/src/org/chromium/chrome/browser/autofill/AutofillAccessibilityUtils.java", "java/src/org/chromium/chrome/browser/autofill/AutofillExpirationDateFixFlowBridge.java", "java/src/org/chromium/chrome/browser/autofill/AutofillLogger.java", @@ -3209,11 +3240,10 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java", "java/src/org/chromium/chrome/browser/autofill/SaveUpdateAddressProfilePrompt.java", "java/src/org/chromium/chrome/browser/autofill/SaveUpdateAddressProfilePromptController.java", - "java/src/org/chromium/chrome/browser/autofill/VirtualCardEnrollmentDelegate.java", - "java/src/org/chromium/chrome/browser/autofill/VirtualCardEnrollmentDialogViewBridge.java", "java/src/org/chromium/chrome/browser/autofill/settings/AutofillPaymentMethodsDelegate.java", "java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfileBridge.java", "java/src/org/chromium/chrome/browser/autofill/settings/VirtualCardEnrollmentFields.java", + "java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridge.java", "java/src/org/chromium/chrome/browser/background_sync/BackgroundSyncBackgroundTask.java", "java/src/org/chromium/chrome/browser/background_sync/BackgroundSyncBackgroundTaskScheduler.java", "java/src/org/chromium/chrome/browser/background_sync/GooglePlayServicesChecker.java", @@ -3221,7 +3251,6 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java", "java/src/org/chromium/chrome/browser/background_task_scheduler/ProxyNativeTask.java", "java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java", - "java/src/org/chromium/chrome/browser/browserservices/QualityEnforcer.java", "java/src/org/chromium/chrome/browser/browserservices/digitalgoods/SiteIsolator.java", "java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappBridge.java", "java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridge.java", @@ -3340,7 +3369,6 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/query_tiles/QueryTileUtils.java", "java/src/org/chromium/chrome/browser/query_tiles/TileProviderFactory.java", "java/src/org/chromium/chrome/browser/query_tiles/TileServiceUtils.java", - "java/src/org/chromium/chrome/browser/read_later/ReadingListBridge.java", "java/src/org/chromium/chrome/browser/renderer_host/ChromeNavigationUIData.java", "java/src/org/chromium/chrome/browser/resources/ResourceMapper.java", "java/src/org/chromium/chrome/browser/rlz/RevenueStats.java", @@ -3469,6 +3497,7 @@ template("libchrome_impl") { deps += [ "//chrome/browser/android/vr:module_factory" ] } + java_targets = [ "//chrome/android:chrome_public_apk" ] forward_variables_from(invoker, "*", [ "deps" ]) } } @@ -3487,6 +3516,8 @@ libchrome_impl("libchrome") { # it comes before the actual (very slow) link step. deps = [ ":libchrome_inputs" ] } + + module_descs = chrome_module_descs } chrome_common_shared_library("libchromefortest") { @@ -3516,9 +3547,6 @@ chrome_common_shared_library("libchromefortest") { if (enable_vr) { deps += [ "//chrome/browser/android/vr:test_support" ] } - if (allow_jni_multiplexing) { - enable_jni_multiplexing = true - } # Make this a partitioned library, since some partitioned code is linked in # (otherwise, the library will warn at build time that it contains multiple @@ -3526,6 +3554,19 @@ chrome_common_shared_library("libchromefortest") { # required or packaged into the APK. This can be removed if LLD starts # supporting a "no partitions" argument (https://crbug.com/1021108). module_descs = [] + + java_targets = [ + "//chrome/android:chrome_public_unit_test_apk__test_apk", + "//chrome/android:chrome_public_test_apk__test_apk", + "//chrome/test/android:chrome_java_test_pagecontroller_tests__test_apk", + "//chrome/test/android:chrome_java_test_wpr_tests__test_apk", + "//chrome/test/android:chrome_java_test_feed_test__test_apk", + "//chrome/test/android:chrome_webapk_integration_tests__test_apk", + "//chrome/test/android:chrome_java_test_pagecontroller_codelab__test_apk", + ] + if (enable_vr) { + java_targets += [ "//chrome/android:chrome_public_test_vr_apk__test_apk" ] + } } # Monochrome equivalent of Chrome's APK or bundle library template. @@ -3550,6 +3591,11 @@ template("libmonochrome_apk_or_bundle_tmpl") { if (allow_jni_multiplexing) { enable_jni_multiplexing = true } + if (android_64bit_target_cpu) { + java_targets = [ "//chrome/android:monochrome_64_public_bundle" ] + } else { + java_targets = [ "//chrome/android:monochrome_public_bundle" ] + } if (enable_vr) { deps += [ "//chrome/browser/android/vr:module_factory" ] diff --git a/src/chrome/android/chrome_public_apk_tmpl.gni b/src/chrome/android/chrome_public_apk_tmpl.gni index d4ac2f52..a9ea421e 100644 --- a/src/chrome/android/chrome_public_apk_tmpl.gni +++ b/src/chrome/android/chrome_public_apk_tmpl.gni @@ -174,6 +174,11 @@ template("chrome_common_apk_or_module_tmpl") { _version_code = chrome_version_code } + # Need to apply override explicitly to have it apply to library version. + if (android_override_version_code != "") { + _version_code = android_override_version_code + } + if (defined(invoker.manifest_package)) { _manifest_package = invoker.manifest_package } else if (_is_test) { @@ -466,7 +471,6 @@ template("chrome_common_apk_or_module_tmpl") { } else if (!_is_trichrome) { deps += [ "//chrome/android:chrome_public_apk_base_module_resources", - "//chrome/android:chrome_public_base_module_java", "//chrome/android:chrome_public_non_pak_assets", "//components/browser_ui/styles/android:chrome_public_apk_resources", ] @@ -478,7 +482,10 @@ template("chrome_common_apk_or_module_tmpl") { "//components/language/android:ulp_delegate_public_java", ] } else { - deps += [ "//chrome/android:delegate_public_impl_java" ] + deps += [ + "//chrome/android:chrome_all_java", + "//chrome/android:delegate_public_impl_java", + ] } if (_is_test) { deps += [ "//chrome/android:chrome_public_base_module_java_for_test" ] @@ -545,32 +552,48 @@ template("chrome_common_apk_or_module_tmpl") { shared_libraries += invoker.shared_libraries } else if (_is_test) { shared_libraries += [ "//chrome/android:libchromefortest" ] - } else if (_is_monochrome) { + srcjar_deps = [ "//chrome/android:libchromefortest__jni_registration($default_toolchain)" ] + } else if (_is_monochrome || _is_trichrome) { + # We are only doing the jni_registrations for Trichrome - the actual + # native libraries will end up in the Trichrome library. if (android_64bit_target_cpu) { # Build //android_webview:monochrome with the opposite bitness that # Chrome runs in. if (_is_64_bit_browser) { - shared_libraries += [ "//chrome/android:libmonochrome_64" ] - if (_include_32_bit_webview) { - secondary_abi_shared_libraries += [ "//android_webview:monochrome_64($android_secondary_abi_toolchain)" ] - } - if (build_hwasan_splits) { - shared_libraries += - [ "//chrome/android:libmonochrome_64($_hwasan_toolchain)" ] + srcjar_deps = [ "//chrome/android:libmonochrome_64__jni_registration($default_toolchain)" ] + if (_is_monochrome) { + shared_libraries += [ "//chrome/android:libmonochrome_64" ] + if (_include_32_bit_webview) { + secondary_abi_shared_libraries += [ "//android_webview:monochrome_64($android_secondary_abi_toolchain)" ] + } + if (build_hwasan_splits) { + shared_libraries += + [ "//chrome/android:libmonochrome_64($_hwasan_toolchain)" ] + } } } else { - if (_include_64_bit_webview) { - shared_libraries += [ "//android_webview:monochrome" ] + srcjar_deps = [ "//chrome/android:libmonochrome__jni_registration($android_secondary_abi_toolchain)" ] + if (_is_monochrome) { + if (_include_64_bit_webview) { + shared_libraries += [ "//android_webview:monochrome" ] + } + secondary_abi_shared_libraries += [ "//chrome/android:libmonochrome($android_secondary_abi_toolchain)" ] } - secondary_abi_shared_libraries += [ - "//chrome/android:libmonochrome($android_secondary_abi_toolchain)", - ] } } else { - shared_libraries += [ "//chrome/android:libmonochrome" ] + srcjar_deps = [ "//chrome/android:libmonochrome__jni_registration($default_toolchain)" ] + if (_is_monochrome) { + shared_libraries += [ "//chrome/android:libmonochrome" ] + } } } else if (!_is_trichrome) { shared_libraries += [ "//chrome/android:libchrome" ] + srcjar_deps = + [ "//chrome/android:libchrome__jni_registration($default_toolchain)" ] + } + + if (defined(invoker.srcjar_deps)) { + srcjar_deps += invoker.srcjar_deps } if (enable_arcore) { @@ -719,6 +742,7 @@ template("chrome_common_apk_or_module_tmpl") { "secondary_abi_loadable_modules", "secondary_abi_shared_libraries", "shared_libraries", + "srcjar_deps", "version_code", "version_name", ]) diff --git a/src/chrome/browser/search/search.cc b/src/chrome/browser/search/search.cc index db0d8c1f..2af4b53a 100644 --- a/src/chrome/browser/search/search.cc +++ b/src/chrome/browser/search/search.cc @@ -1,4 +1,4 @@ -// Copyright 2023 The Chromium Authors and Alex313031. All rights reserved. +// Copyright 2012 The Chromium Authors and Alex313031 // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,8 +30,8 @@ #include "url/gurl.h" #if BUILDFLAG(ENABLE_SUPERVISED_USERS) -#include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/supervised_user/supervised_user_service_factory.h" +#include "components/supervised_user/core/browser/supervised_user_service.h" #include "components/supervised_user/core/browser/supervised_user_url_filter.h" // nogncheck #endif @@ -140,7 +140,7 @@ bool IsNTPOrRelatedURLHelper(const GURL& url, Profile* profile) { bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) { #if BUILDFLAG(ENABLE_SUPERVISED_USERS) - SupervisedUserService* supervised_user_service = + supervised_user::SupervisedUserService* supervised_user_service = SupervisedUserServiceFactory::GetForProfile(profile); if (!supervised_user_service || !supervised_user_service->IsURLFilteringEnabled()) { diff --git a/src/chrome/browser/ui/android/strings/android_chrome_strings.grd b/src/chrome/browser/ui/android/strings/android_chrome_strings.grd index d44602b3..f3377487 100644 --- a/src/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/src/chrome/browser/ui/android/strings/android_chrome_strings.grd @@ -600,9 +600,6 @@ CHAR_LIMIT guidelines: Warn you if passwords are exposed in a data breach - - When you sign in to your Google Account, this feature is turned on - Check passwords @@ -732,18 +729,25 @@ CHAR_LIMIT guidelines: Details: %1$sIOException: No space left on device - - Unified password manager error - - - The unified password manager was automatically disabled. Please submit an issue via the bug app! - Not secure To protect your privacy, Thorium will not autofill your password in this field. + + We’re changing how passwords are saved on this device + + + Your lists of saved passwords for Thorium and Thorium %1$sDev will merge after version 121. You’ll be able to autofill all your saved passwords on both apps. + + + Got it + + + Other options + + @@ -841,8 +845,8 @@ CHAR_LIMIT guidelines: By including more of a page’s text, you might see better results - - “Do Not Track” + + Send a “Do Not Track” request Enabling “Do Not Track” means that a request will be included with your browsing traffic. Any effect depends on whether a website responds to the request, and how the request is interpreted. @@ -866,6 +870,9 @@ For example, some websites may respond to this request by showing you ads that a Learn about and control new technologies that aim to replace third-party cookies + + Manage info used by sites to measure ad performance + Trials @@ -1069,14 +1076,17 @@ Private state tokens improve privacy on the web and can’t be used to find out - + With ad measurement, limited types of data can be shared among sites and apps to measure the performance of their ads, such as the time of day an ad was shown to you. To measure the performance of an ad, limited types of data can be shared among sites, such as the time of day an ad was shown to you. - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + We’re launching a new ad privacy feature called ad measurement. Thorium shares only very limited information among sites and apps, such as when an ad was shown to you, to help measure the performance of ads. + + + Your Android device may include a similar setting. If this setting is turned on in Thorium and on your Android device, a company may be able to measure the effectiveness of an ad across websites you visit and apps you use. Your Android device may include a similar setting. If Ad measurement is turned on in Thorium and on your Android device, a company may be able to measure the effectiveness of an ad across web sites you visit and apps you use. @@ -1347,9 +1357,6 @@ Your Google account may have other forms of browsing history like searches and a Time range - - Last 15 minutes - Last hour @@ -1488,7 +1495,7 @@ Your Google account may have other forms of browsing history like searches and a Privacy Sandbox trial - See how Thorium plans to safeguard you from cross-site tracking while preserving the open web + Thorium is exploring new features that allow sites to deliver the same browsing experience using less of your data Web & App Activity @@ -1726,9 +1733,6 @@ Your Google account may have other forms of browsing history like searches and a Add language - - Change language - Select language @@ -1959,30 +1963,6 @@ Your Google account may have other forms of browsing history like searches and a - - Parental Settings - - - Waiting for details of parents. - - - This browser is managed by %1$sparent1@gmail.com. - - - This browser is managed by %1$sparent1@gmail.com and %2$sparent2@gmail.com. - - - Content - - - Only allow certain sites - - - Try to block mature sites - - - Allow all sites - If you need help, ask your parent @@ -2260,9 +2240,6 @@ To change this setting, <resetlink>reset sync

Sync needs to verify it's you - - Sign in again to start sync - Sign back in to start sync @@ -2864,6 +2841,12 @@ To change this setting, <resetlink>reset sync

Files that you download appear here + + You’ll find your downloads here + + + You can save images and files to view offline or share in other apps + Open with… @@ -2914,6 +2897,12 @@ To change this setting, <resetlink>reset sync

Pages that you visit appear here + + You’ll find your history here + + + You can see the pages you’ve visited or clear them from your history + Can’t find that page. Check your spelling or try a search on %1$sGoogle. @@ -2976,10 +2965,10 @@ To change this setting, <resetlink>reset sync

- %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Google Thorium and ThoriumOS Additional Terms of Service</LINK2>. + %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Thorium and ThoriumOS Additional Terms of Service</LINK2>. - %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Google Thorium and ThoriumOS Additional Terms of Service</LINK2>. The <LINK3>Privacy Policy</LINK3> also applies. + %1$sGoogle Maps will open in Thorium. By continuing, you agree to the <LINK1>Google Terms of Service</LINK1>, and the <LINK2>Thorium and ThoriumOS Additional Terms of Service</LINK2>. The <LINK3>Privacy Policy</LINK3> also applies. Accept & continue @@ -3050,21 +3039,26 @@ To change this setting, <resetlink>reset sync

- - - Keep your data secure with profile lock + + Create a profile lock for your car - - For your data security in the car, profile lock is required to sync and save your passwords, payments, and more. + + Your info is secured with a profile lock - - Your saved data will be erased if profile lock is removed later + + To sync your info and keep your data secure in the car, you must create a profile lock. You’ll use a code or password every time you enter the car. - - Set up a profile lock + + To sync your info and keep your data secure in the car, you must create a profile lock in your security settings. You’ll use a code or password every time you enter the car. - - I understand + + Your profile lock keeps your info secure in the car, including synced passwords, payments and more. + + + Your saved info will be erased if you remove profile lock later. + + + Create a profile lock @@ -3156,6 +3150,14 @@ To change this setting, <resetlink>reset sync

+ + + Get better suggestions + + + Sync to get the most relevant content from Google + + Continue as %1$sJohn @@ -3371,7 +3373,9 @@ To change this setting, <resetlink>reset sync

Discover by Google - off - Following + Following Control your stories and activity here @@ -3433,71 +3437,6 @@ To change this setting, <resetlink>reset sync

- - - How to use Thorium - - - How to search with Thorium - - - How to search with your voice - - - How to download content for later - - - Videos about how to use Thorium - - - Learn Thorium - - - Popular videos - - - Navigate Thorium - - - Search the internet - - - Use voice search - - - Download content - - - Pick your language - - - Watch - - - Try now - - - Watch next video - - - Change %1$sHindi? - - - Share - - - Close - - - Tap here to start - - - Type here or tap the voice icon to start - - - Loading… - - Thorium tips @@ -3680,10 +3619,15 @@ To change this setting, <resetlink>reset sync

Find in page + + View page insights + Follow - + Following @@ -3745,6 +3689,18 @@ To change this setting, <resetlink>reset sync

No bookmarks + + You’ll find your bookmarks here + + + You can get back to a page that’s important to you by adding a bookmark + + + You’ll find your reading list here + + + You can save pages to read later or offline + {BOOKMARKS_COUNT, plural, =1 {%1$d1 bookmark} @@ -3893,9 +3849,6 @@ To change this setting, <resetlink>reset sync

Organize your tracked products in Bookmarks - - Organize your tracked products in Bookmarks from the folder icon - Sort and view options @@ -3937,14 +3890,6 @@ To change this setting, <resetlink>reset sync

Mark as unread - - Catch up on your reading list - - - {READING_LIST_REMINDER_NOTIFICATION_SUBTITLE, plural, - =1 {You have %1$d1 unread page} - other {You have %1$d8 unread pages}} - {READING_LIST_UNREAD_PAGE_COUNT, plural, =1 {%1$d1 unread page} @@ -4517,15 +4462,6 @@ To change this setting, <resetlink>reset sync

Linked sites - - %1$s404 on %2$shttps://example.com/ - - - Digital asset links verification failed on %1$shttps://example.com/ - - - Page unavailable offline: %1$shttps://example.com/ - Tap to copy the URL for this app @@ -4598,14 +4534,14 @@ To change this setting, <resetlink>reset sync

Reload the current page, ignoring cached content - + Open the Thorium Help Center in a new tab Tab and window shortcuts - Google Thorium feature shortcuts + Thorium feature shortcuts Webpage shortcuts @@ -5059,7 +4995,7 @@ To change this setting, <resetlink>reset sync

- Google Thorium as a Security Key + Thorium as a Security Key <resetlink>reset sync

+ + Send to devices + + Include link @@ -5511,7 +5451,7 @@ To change this setting, <resetlink>reset sync

- Use Lite mode on Google Thorium + Use Lite mode on Thorium Google recommends Thorium @@ -5763,12 +5703,29 @@ To change this setting, <resetlink>reset sync

+ + + Bottom sheet + + + Side sheet + + + Full-size sheet + + Delete last 15 minutes? - Following data from the last 15 minutes will be deleted: + History from the last 15 minutes will be deleted: + + + {NUM_TABS, plural, =1 {1 tab on this device} other {# tabs on this device}} + + + Cookies, cache, and other site data <link1>Search history</link1> and <link2>other forms of activity</link2> may be saved in your Google Account diff --git a/src/chrome/browser/ui/browser.cc b/src/chrome/browser/ui/browser.cc index 735871ab..f63facb6 100644 --- a/src/chrome/browser/ui/browser.cc +++ b/src/chrome/browser/ui/browser.cc @@ -990,7 +990,7 @@ Browser::DownloadCloseType Browser::OkToCloseWithInProgressDownloads( return DownloadCloseType::kOk; int total_download_count = - DownloadCoreService::NonMaliciousDownloadCountAllProfiles(); + DownloadCoreService::BlockingShutdownCountAllProfiles(); if (total_download_count == 0) return DownloadCloseType::kOk; // No downloads; can definitely close. @@ -1023,10 +1023,9 @@ Browser::DownloadCloseType Browser::OkToCloseWithInProgressDownloads( DownloadCoreService* download_core_service = DownloadCoreServiceFactory::GetForBrowserContext(profile()); if ((profile_window_count == 0) && - (download_core_service->NonMaliciousDownloadCount() > 0) && + (download_core_service->BlockingShutdownCount() > 0) && (profile()->IsIncognitoProfile() || profile()->IsGuestSession())) { - *num_downloads_blocking = - download_core_service->NonMaliciousDownloadCount(); + *num_downloads_blocking = download_core_service->BlockingShutdownCount(); return profile()->IsGuestSession() ? DownloadCloseType::kLastWindowInGuestSession : DownloadCloseType::kLastWindowInIncognitoProfile; @@ -3296,7 +3295,7 @@ BackgroundContents* Browser::CreateBackgroundContents( } #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) -// TODO(https://1278249): Update function name (and trigger chain) when usage +// TODO(crbug.com/1443349): Update function name (and trigger chain) when usage // is finalized. void Browser::RunScreenAIAnnotator() { screen_ai::AXScreenAIAnnotatorFactory::GetForBrowserContext(profile()) diff --git a/src/chrome/browser/ui/views/accelerator_table.cc b/src/chrome/browser/ui/views/accelerator_table.cc index 539dc49c..132b6b9b 100644 --- a/src/chrome/browser/ui/views/accelerator_table.cc +++ b/src/chrome/browser/ui/views/accelerator_table.cc @@ -26,6 +26,10 @@ namespace { +// For ChromeOS only: If you plan on adding a new accelerator and want it +// displayed in the Shortcuts app, please follow the instructions at: +// `ash/webui/shortcut_customization_ui/backend/accelerator_layout_table.h`. + // NOTE: Between each ifdef block, keep the list in the same // (mostly-alphabetical) order as the Windows accelerators in // ../../app/chrome_dll.rc. diff --git a/src/chrome/browser/ui/views/tabs/tab.cc b/src/chrome/browser/ui/views/tabs/tab.cc index 6e1394ae..94f20cd2 100644 --- a/src/chrome/browser/ui/views/tabs/tab.cc +++ b/src/chrome/browser/ui/views/tabs/tab.cc @@ -213,6 +213,7 @@ Tab::Tab(TabSlotController* controller) title_->SetAutoColorReadabilityEnabled(false); title_->SetText(CoreTabHelper::GetDefaultTitle()); title_->SetFontList(tab_style_views_->GetFontList()); + title_->SetBackgroundColor(SK_ColorTRANSPARENT); // |title_| paints on top of an opaque region (the tab background) of a // non-opaque layer (the tabstrip's layer), which cannot currently be detected // by the subpixel-rendering opacity check. @@ -820,6 +821,7 @@ bool Tab::IsActive() const { void Tab::ActiveStateChanged() { UpdateTabIconNeedsAttentionBlocked(); UpdateForegroundColors(); + icon_->SetActiveState(IsActive()); alert_indicator_button_->OnParentTabButtonColorChanged(); title_->SetFontList(tab_style_views_->GetFontList()); Layout(); diff --git a/src/chrome/browser/ui/views/tabs/tab_strip.cc b/src/chrome/browser/ui/views/tabs/tab_strip.cc index 90e29c1e..2e678b31 100644 --- a/src/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/src/chrome/browser/ui/views/tabs/tab_strip.cc @@ -72,6 +72,7 @@ #include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" +#include "chromeos/constants/chromeos_features.h" #include "components/crash/core/common/crash_key.h" #include "components/tab_groups/tab_group_color.h" #include "components/tab_groups/tab_group_id.h" @@ -178,7 +179,7 @@ class TabStrip::TabDragContextImpl : public TabDragContext, } bool OnMouseDragged(const ui::MouseEvent& event) override { - ContinueDrag(this, event); + (void)ContinueDrag(this, event); return true; } @@ -189,6 +190,7 @@ class TabStrip::TabDragContextImpl : public TabDragContext, void OnMouseCaptureLost() override { EndDrag(END_DRAG_CAPTURE_LOST); } void OnGestureEvent(ui::GestureEvent* event) override { + Liveness tabstrip_alive = Liveness::kAlive; switch (event->type()) { case ui::ET_GESTURE_SCROLL_END: case ui::ET_SCROLL_FLING_START: @@ -202,7 +204,8 @@ class TabStrip::TabDragContextImpl : public TabDragContext, } case ui::ET_GESTURE_SCROLL_UPDATE: - ContinueDrag(this, *event); + // N.B. !! ContinueDrag may enter a nested run loop !! + tabstrip_alive = ContinueDrag(this, *event); break; case ui::ET_GESTURE_TAP_DOWN: @@ -214,6 +217,12 @@ class TabStrip::TabDragContextImpl : public TabDragContext, } event->SetHandled(); + // If tabstrip was destroyed (during ContinueDrag above), return early to + // avoid UAF below. + if (tabstrip_alive == Liveness::kDeleted) { + return; + } + // TabDragContext gets event capture as soon as a drag session begins, which // precludes TabStrip from ever getting events like tap or long tap. Forward // this on to TabStrip so it can respond to those events. @@ -302,20 +311,20 @@ class TabStrip::TabDragContextImpl : public TabDragContext, std::move(drag_controller_set_callback_).Run(drag_controller_.get()); } - void ContinueDrag(views::View* view, const ui::LocatedEvent& event) { - if (drag_controller_.get() && - drag_controller_->event_source() == EventSourceFromEvent(event)) { - gfx::Point screen_location(event.location()); - views::View::ConvertPointToScreen(view, &screen_location); - - // Note: |tab_strip_| can be destroyed during drag, also destroying - // |this|. - base::WeakPtr weak_ptr(weak_factory_.GetWeakPtr()); - drag_controller_->Drag(screen_location); - - if (!weak_ptr) - return; + Liveness ContinueDrag(views::View* view, const ui::LocatedEvent& event) { + if (!drag_controller_.get() || + drag_controller_->event_source() != EventSourceFromEvent(event)) { + return Liveness::kAlive; } + + gfx::Point screen_location(event.location()); + views::View::ConvertPointToScreen(view, &screen_location); + + // Note: `tab_strip_` can be destroyed during drag, also destroying `this`. + base::WeakPtr weak_ptr(weak_factory_.GetWeakPtr()); + drag_controller_->Drag(screen_location); + + return weak_ptr ? Liveness::kAlive : Liveness::kDeleted; } bool EndDrag(EndDragReason reason) { @@ -604,7 +613,7 @@ class TabStrip::TabDragContextImpl : public TabDragContext, int source_view_index = static_cast( base::ranges::find(views, source_view) - views.begin()); - const auto should_animate_tab = [=, &views, this](int index_in_views) { + const auto should_animate_tab = [&](size_t index_in_views) { // If the tab at `index_in_views` is already animating, don't interrupt // it. if (bounds_animator_.IsAnimating(views[index_in_views])) @@ -1163,6 +1172,12 @@ bool TabStrip::ShouldDrawStrokes() const { return false; } +#if BUILDFLAG(IS_CHROMEOS_ASH) + if (chromeos::features::IsJellyrollEnabled()) { + return false; + } +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + // The tabstrip normally avoids strokes and relies on the active tab // contrasting sufficiently with the frame background. When there isn't // enough contrast, fall back to a stroke. Always compute the contrast ratio @@ -1606,8 +1621,10 @@ void TabStrip::MaybeStartDrag( drag_context_->MaybeStartDrag(source, event, original_selection); } -void TabStrip::ContinueDrag(views::View* view, const ui::LocatedEvent& event) { - drag_context_->ContinueDrag(view, event); +TabSlotController::Liveness TabStrip::ContinueDrag( + views::View* view, + const ui::LocatedEvent& event) { + return drag_context_->ContinueDrag(view, event); } bool TabStrip::EndDrag(EndDragReason reason) { diff --git a/src/chrome/browser/ui/views/toolbar/toolbar_view.cc b/src/chrome/browser/ui/views/toolbar/toolbar_view.cc index 73a8ade3..90ca78ad 100644 --- a/src/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/src/chrome/browser/ui/views/toolbar/toolbar_view.cc @@ -39,9 +39,12 @@ #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/ui/intent_picker_tab_helper.h" #include "chrome/browser/ui/layout_constants.h" +#include "chrome/browser/ui/side_panel/companion/companion_utils.h" #include "chrome/browser/ui/side_search/side_search_utils.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/ui/toolbar/chrome_labs_model.h" #include "chrome/browser/ui/toolbar/chrome_labs_prefs.h" +#include "chrome/browser/ui/toolbar/chrome_labs_utils.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" @@ -66,9 +69,7 @@ #include "chrome/browser/ui/views/toolbar/app_menu.h" #include "chrome/browser/ui/views/toolbar/back_forward_button.h" #include "chrome/browser/ui/views/toolbar/browser_app_menu_button.h" -#include "chrome/browser/ui/views/toolbar/chrome_labs_bubble_view_model.h" #include "chrome/browser/ui/views/toolbar/chrome_labs_button.h" -#include "chrome/browser/ui/views/toolbar/chrome_labs_utils.h" #include "chrome/browser/ui/views/toolbar/home_button.h" #include "chrome/browser/ui/views/toolbar/reload_button.h" #include "chrome/browser/ui/views/toolbar/side_panel_toolbar_button.h" @@ -167,6 +168,8 @@ constexpr int kToolbarDividerWidth = 2; constexpr int kToolbarDividerHeight = 16; constexpr int kToolbarDividerCornerRadius = 1; constexpr int kToolbarDividerSpacing = 9; +constexpr int kBrowserAppMenuRefreshExpandedMargin = 5; +constexpr int kBrowserAppMenuRefreshCollapsedMargin = 2; } // namespace @@ -316,8 +319,7 @@ void ToolbarView::Init() { std::unique_ptr side_panel_toolbar_container; if (browser_view_->unified_side_panel() && !base::CommandLine::ForCurrentProcess()->HasSwitch("hide-sidepanel-button")) { - if (base::FeatureList::IsEnabled( - companion::features::kSidePanelCompanion)) { + if (companion::IsCompanionFeatureEnabled()) { side_panel_toolbar_container = std::make_unique(browser_view_); } else { @@ -343,11 +345,10 @@ void ToolbarView::Init() { } if (base::FeatureList::IsEnabled(features::kChromeLabs)) { - chrome_labs_model_ = std::make_unique(); + chrome_labs_model_ = std::make_unique(); UpdateChromeLabsNewBadgePrefs(browser_->profile(), chrome_labs_model_.get()); - if (ChromeLabsButton::ShouldShowButton(chrome_labs_model_.get(), - browser_->profile())) { + if (ShouldShowChromeLabsUI(chrome_labs_model_.get(), browser_->profile())) { chrome_labs_button_ = AddChildView(std::make_unique( browser_view_, chrome_labs_model_.get())); @@ -827,10 +828,26 @@ void ToolbarView::InitLayout() { void ToolbarView::LayoutCommon() { DCHECK(display_mode_ == DisplayMode::NORMAL); - const gfx::Insets interior_margin = + gfx::Insets interior_margin = GetLayoutInsets(browser_view_->webui_tab_strip() ? LayoutInset::WEBUI_TAB_STRIP_TOOLBAR_INTERIOR_MARGIN : LayoutInset::TOOLBAR_INTERIOR_MARGIN); + + if (features::IsChromeRefresh2023() && !browser_view_->webui_tab_strip()) { + if (app_menu_button_->IsLabelPresentAndVisible()) { + // The interior margin in an expanded state should be more than in a + // collapsed state. + interior_margin.set_right(interior_margin.right() + 1); + app_menu_button_->SetProperty( + views::kMarginsKey, + gfx::Insets::VH(0, kBrowserAppMenuRefreshExpandedMargin)); + } else { + app_menu_button_->SetProperty( + views::kMarginsKey, + gfx::Insets::VH(0, kBrowserAppMenuRefreshCollapsedMargin)); + } + } + layout_manager_->SetInteriorMargin(interior_margin); // Extend buttons to the window edge if we're either in a maximized or diff --git a/src/chromeos/chromeos_strings.grd b/src/chromeos/chromeos_strings.grd index a48c29ad..b75dc48e 100644 --- a/src/chromeos/chromeos_strings.grd +++ b/src/chromeos/chromeos_strings.grd @@ -294,6 +294,9 @@ $1Cannot connect to the internet. Click to try again.: Retry + + more + Internal only @@ -308,7 +311,7 @@ - Half + Split Partial @@ -441,7 +444,7 @@ Use as a personal device - Install ThoriumOS + Install ThoriumOS Flex Launcher @@ -648,6 +651,9 @@ Failed - Authorization Failed + + Failed - Certificate Expired + Failed - Unknown error @@ -690,6 +696,15 @@ Printing + + No printer jobs + + + Go to Printer settings to manage your printers + + + Manage printers + @@ -2479,7 +2494,7 @@ Dawn to dark - Select Thoriumbook exclusive artwork + Select $1Thoriumbook exclusive artwork $1Google Photos $2Select your memories selected, press Enter to select $1Google Photos albums @@ -2679,13 +2694,16 @@ Earth Flow - Thoriumbook exclusive + $1Thoriumbook exclusive - Exclusive Thoriumbook assets now available + Exclusive $1Thoriumbook assets now available - You now have access to new <a href="chrome://personalization/wallpaper">wallpapers</a> and <a href="chrome://personalization/ambient">screen saver</a> + You now have access to new <a href="chrome://personalization/wallpaper/collection?id=_time_of_day_chromebook_collection">wallpapers</a> and <a href="chrome://personalization/ambient">screen saver</a> + + + You now have access to new <a href="chrome://personalization/wallpaper/collection?id=_time_of_day_chromebook_collection">wallpapers</a> @@ -2812,6 +2830,36 @@ Automatic dark theme + + Theme + + + Theme color + + + Accent color + + + System color + + + Launcher color + + + Wallpaper color + + + Desktop color + + + Background image + + + UI color + + + Interface color + Keyboard backlight @@ -2830,6 +2878,51 @@ backlit color + + keyboard underglow + + + keyboard light + + + keyboard multicolor + + + keyboard hue + + + keyboard customize + + + keyboard brighten + + + keyboard brighter + + + keyboard brightness + + + keyboard dim + + + keyboard dimming + + + keyboard darken + + + keyboard darker + + + key color + + + keyboard zone + + + rgb controls + @@ -3862,21 +3955,24 @@ Shortcut is used by $1BRIGHTNESS_UP. Press a new shortcut or press the same one again to use it for this action instead. - + No search results found - + Clear search - + Search shortcuts - + or - + Search result $11 of $22: $3Open new tab, ctrl T. Press Enter to navigate to shortcut. + + No shortcut assigned + General @@ -3991,8 +4087,8 @@ refresh - - search + + browser search toggle dictation @@ -4045,8 +4141,11 @@ mode change - - launcher + + open launcher + + + open search power @@ -4060,6 +4159,9 @@ settings + + view all apps + full screen @@ -4084,8 +4186,11 @@ You are not connected yet. If your mobile carrier recommends a custom APN, enter the APN information by selecting "+ New APN" + + Can’t connect to this network using automatically detected APNs. Contact your mobile carrier for more information. + - Can't connect to any enabled custom APNs. Contact your mobile carrier for more information. + Can’t connect to this network using any enabled custom APNs. Contact your mobile carrier for more information. Details @@ -4100,7 +4205,7 @@ Remove - More actions + More actions for $1vzwinternet Add a new APN @@ -4157,7 +4262,7 @@ Automatically detected - Can't disable or remove this APN. Make sure enabled attached APNs are disabled or removed. + Can't disable or remove this APN. Make sure enabled attach APNs are disabled or removed. Add diff --git a/src/components/history/core/browser/history_backend.cc b/src/components/history/core/browser/history_backend.cc index 30d7ccdd..cd28dcc9 100644 --- a/src/components/history/core/browser/history_backend.cc +++ b/src/components/history/core/browser/history_backend.cc @@ -715,7 +715,7 @@ void HistoryBackend::SetPageLanguageForVisitByVisitID( annotations.page_language = page_language; db_->AddContentAnnotationsForVisit(visit_id, annotations); } - NotifyVisitUpdated(visit_row); + NotifyVisitUpdated(visit_row, VisitUpdateReason::kSetPageLanguage); ScheduleCommit(); } } @@ -752,7 +752,7 @@ void HistoryBackend::SetPasswordStateForVisitByVisitID( annotations.password_state = password_state; db_->AddContentAnnotationsForVisit(visit_id, annotations); } - NotifyVisitUpdated(visit_row); + NotifyVisitUpdated(visit_row, VisitUpdateReason::kSetPasswordState); ScheduleCommit(); } } @@ -891,7 +891,7 @@ void HistoryBackend::UpdateVisitDuration(VisitID visit_id, const Time end_ts) { ? end_ts - visit_row.visit_time : base::Microseconds(0); db_->UpdateVisitRow(visit_row); - NotifyVisitUpdated(visit_row); + NotifyVisitUpdated(visit_row, VisitUpdateReason::kUpdateVisitDuration); } } @@ -1079,7 +1079,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) { visit_row.transition = ui::PageTransitionFromInt( visit_row.transition & ~ui::PAGE_TRANSITION_CHAIN_END); db_->UpdateVisitRow(visit_row); - NotifyVisitUpdated(visit_row); + NotifyVisitUpdated(visit_row, VisitUpdateReason::kUpdateTransition); } extended_redirect_chain = GetCachedRecentRedirects(request.referrer); @@ -1304,7 +1304,7 @@ void HistoryBackend::InitImpl( // Get the first item in our database. db_->GetStartDate(&first_recorded_time_); - // Start expiring old stuff if flag unset. + // Start expiring old stuff if flag is unset. if (!base::CommandLine::ForCurrentProcess()->HasSwitch("keep-all-history")) expirer_.StartExpiringOldStuff(base::Days(kExpireDaysThreshold)); } @@ -1809,7 +1809,7 @@ VisitID HistoryBackend::UpdateSyncedVisit( content_annotations->password_state); } - NotifyVisitUpdated(updated_row); + NotifyVisitUpdated(updated_row, VisitUpdateReason::kUpdateSyncedVisit); ScheduleCommit(); return updated_row.visit_id; } @@ -2149,7 +2149,7 @@ void HistoryBackend::AddContextAnnotationsForVisit( if (!db_ || !db_->GetRowForVisit(visit_id, &visit_row)) return; db_->AddContextAnnotationsForVisit(visit_id, visit_context_annotations); - NotifyVisitUpdated(visit_row); + NotifyVisitUpdated(visit_row, VisitUpdateReason::kAddContextAnnotations); ScheduleCommit(); } @@ -2171,7 +2171,8 @@ void HistoryBackend::SetOnCloseContextAnnotationsForVisit( } else { db_->AddContextAnnotationsForVisit(visit_id, visit_context_annotations); } - NotifyVisitUpdated(visit_row); + NotifyVisitUpdated(visit_row, + VisitUpdateReason::kSetOnCloseContextAnnotations); ScheduleCommit(); } @@ -3534,9 +3535,10 @@ void HistoryBackend::NotifyURLsDeleted(DeletionInfo deletion_info) { delegate_->NotifyURLsDeleted(std::move(deletion_info)); } -void HistoryBackend::NotifyVisitUpdated(const VisitRow& visit) { +void HistoryBackend::NotifyVisitUpdated(const VisitRow& visit, + VisitUpdateReason reason) { for (HistoryBackendObserver& observer : observers_) { - observer.OnVisitUpdated(visit); + observer.OnVisitUpdated(visit, reason); } } diff --git a/src/content/browser/BUILD.gn b/src/content/browser/BUILD.gn index 5337992d..536fea5f 100644 --- a/src/content/browser/BUILD.gn +++ b/src/content/browser/BUILD.gn @@ -120,7 +120,6 @@ source_set("browser") { "//components/viz/host", "//components/web_package", "//content:content_resources", - "//content:dev_ui_content_resources", "//content/browser/aggregation_service:mojo_bindings", "//content/browser/aggregation_service/proto:aggregatable_report_proto", "//content/browser/attribution_reporting:attribution_reporting_proto", @@ -448,6 +447,8 @@ source_set("browser") { "attribution_reporting/attribution_manager_impl.cc", "attribution_reporting/attribution_manager_impl.h", "attribution_reporting/attribution_observer.h", + "attribution_reporting/attribution_os_level_manager.cc", + "attribution_reporting/attribution_os_level_manager.h", "attribution_reporting/attribution_report.cc", "attribution_reporting/attribution_report.h", "attribution_reporting/attribution_report_network_sender.cc", @@ -472,6 +473,10 @@ source_set("browser") { "attribution_reporting/common_source_info.h", "attribution_reporting/create_report_result.cc", "attribution_reporting/create_report_result.h", + "attribution_reporting/destination_throttler.cc", + "attribution_reporting/destination_throttler.h", + "attribution_reporting/os_registration.cc", + "attribution_reporting/os_registration.h", "attribution_reporting/rate_limit_result.h", "attribution_reporting/rate_limit_table.cc", "attribution_reporting/rate_limit_table.h", @@ -647,10 +652,8 @@ source_set("browser") { "browsing_topics/browsing_topics_site_data_manager_impl.h", "browsing_topics/browsing_topics_site_data_storage.cc", "browsing_topics/browsing_topics_site_data_storage.h", - "browsing_topics/browsing_topics_url_loader.cc", - "browsing_topics/browsing_topics_url_loader.h", - "browsing_topics/browsing_topics_url_loader_service.cc", - "browsing_topics/browsing_topics_url_loader_service.h", + "browsing_topics/browsing_topics_url_loader_interceptor.cc", + "browsing_topics/browsing_topics_url_loader_interceptor.h", "browsing_topics/header_util.cc", "browsing_topics/header_util.h", "buckets/bucket_context.h", @@ -903,6 +906,8 @@ source_set("browser") { "download/save_package_serialization_handler.h", "download/save_types.cc", "download/save_types.h", + "environment_integrity/environment_integrity_service_impl.cc", + "environment_integrity/environment_integrity_service_impl.h", "eye_dropper_chooser_impl.cc", "eye_dropper_chooser_impl.h", "feature_observer.cc", @@ -1118,10 +1123,14 @@ source_set("browser") { "installedapp/installed_app_provider_impl.h", "interest_group/ad_auction_document_data.cc", "interest_group/ad_auction_document_data.h", + "interest_group/ad_auction_page_data.cc", + "interest_group/ad_auction_page_data.h", "interest_group/ad_auction_result_metrics.cc", "interest_group/ad_auction_result_metrics.h", "interest_group/ad_auction_service_impl.cc", "interest_group/ad_auction_service_impl.h", + "interest_group/ad_auction_url_loader_interceptor.cc", + "interest_group/ad_auction_url_loader_interceptor.h", "interest_group/auction_metrics_recorder.cc", "interest_group/auction_metrics_recorder.h", "interest_group/auction_process_manager.cc", @@ -1209,12 +1218,16 @@ source_set("browser") { "loader/object_navigation_fallback_body_loader.h", "loader/prefetch_url_loader.cc", "loader/prefetch_url_loader.h", - "loader/prefetch_url_loader_service.cc", - "loader/prefetch_url_loader_service.h", + "loader/prefetch_url_loader_service_context.cc", + "loader/prefetch_url_loader_service_context.h", "loader/resource_cache_manager.cc", "loader/resource_cache_manager.h", "loader/shared_cors_origin_access_list_impl.cc", "loader/shared_cors_origin_access_list_impl.h", + "loader/subresource_proxying_url_loader.cc", + "loader/subresource_proxying_url_loader.h", + "loader/subresource_proxying_url_loader_service.cc", + "loader/subresource_proxying_url_loader_service.h", "loader/url_loader_throttles.cc", "locks/lock_manager.cc", "locks/lock_manager.h", @@ -1321,6 +1334,8 @@ source_set("browser") { "message_port_provider.cc", "metrics/histogram_controller.cc", "metrics/histogram_controller.h", + "metrics/histogram_shared_memory_config.cc", + "metrics/histogram_shared_memory_config.h", "metrics/histogram_subscriber.h", "metrics/histogram_synchronizer.cc", "metrics/histogram_synchronizer.h", @@ -1493,6 +1508,8 @@ source_set("browser") { "preloading/preloading_decider.h", "preloading/preloading_prediction.cc", "preloading/preloading_prediction.h", + "preloading/prerender/devtools_prerender_attempt.cc", + "preloading/prerender/devtools_prerender_attempt.h", "preloading/prerender/prerender_attributes.cc", "preloading/prerender/prerender_attributes.h", "preloading/prerender/prerender_commit_deferring_condition.cc", @@ -1793,6 +1810,8 @@ source_set("browser") { "renderer_host/media/video_capture_provider_switcher.h", "renderer_host/media/virtual_video_capture_devices_changed_observer.cc", "renderer_host/media/virtual_video_capture_devices_changed_observer.h", + "renderer_host/mixed_content_checker.cc", + "renderer_host/mixed_content_checker.h", "renderer_host/mixed_content_navigation_throttle.cc", "renderer_host/mixed_content_navigation_throttle.h", "renderer_host/native_web_keyboard_event_aura.cc", @@ -1908,6 +1927,7 @@ source_set("browser") { "renderer_host/stored_page.h", "renderer_host/subframe_history_navigation_throttle.cc", "renderer_host/subframe_history_navigation_throttle.h", + "renderer_host/system_entropy_utils.h", "renderer_host/text_input_manager.cc", "renderer_host/text_input_manager.h", "renderer_host/transient_allow_popup.cc", @@ -2248,6 +2268,8 @@ source_set("browser") { "webid/federated_provider_fetcher.h", "webid/flags.cc", "webid/flags.h", + "webid/identity_registry.cc", + "webid/identity_registry.h", "webid/idp_network_request_manager.cc", "webid/idp_network_request_manager.h", "webid/mdocs/mdoc_provider.cc", @@ -2364,7 +2386,6 @@ source_set("browser") { "font_access/font_enumeration_data_source_linux.h", "font_service.cc", "font_service.h", - "media/stable_video_decoder_factory.cc", "media/video_encode_accelerator_provider_launcher.cc", "media/video_encode_accelerator_provider_launcher.h", "memory/swap_metrics_driver_impl_linux.cc", @@ -2383,11 +2404,15 @@ source_set("browser") { "//components/crash/content/browser/error_reporting", "//components/services/font:lib", "//content/common:sandbox_support_linux", - "//media/mojo/mojom/stable:stable_video_decoder", "//third_party/blink/public/mojom:memory_usage_monitor_linux_mojo_bindings", ] } + if (allow_oop_video_decoder) { + sources += [ "media/stable_video_decoder_factory.cc" ] + deps += [ "//media/mojo/mojom/stable:stable_video_decoder" ] + } + if (is_chromeos) { sources += [ "handwriting/handwriting_recognition_service_impl_cros.cc", @@ -2488,7 +2513,6 @@ source_set("browser") { deps += [ "//third_party/abseil-cpp:absl", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics_cpp", - "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.accessibility.semantics:fuchsia.accessibility.semantics_cpp_hlcpp_conversion", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_hlcpp", "//third_party/fuchsia-sdk/sdk/pkg/inspect", "//third_party/fuchsia-sdk/sdk/pkg/sys_inspect_cpp", @@ -2755,6 +2779,7 @@ source_set("browser") { ] deps += [ "//components/services/screen_ai/public/cpp:utilities", + "//content/utility:delegate_data", "//third_party/blink/public/common:font_unique_name_table_proto", "//third_party/iaccessible2", "//third_party/isimpledom", @@ -2977,6 +3002,8 @@ source_set("browser") { "android/gpu_process_callback.cc", "android/ime_adapter_android.cc", "android/ime_adapter_android.h", + "android/impression_utils.cc", + "android/impression_utils.h", "android/java/gin_java_bound_object.cc", "android/java/gin_java_bound_object.h", "android/java/gin_java_bound_object_delegate.cc", @@ -3021,6 +3048,8 @@ source_set("browser") { "android/select_popup.h", "android/selection/composited_touch_handle_drawable.cc", "android/selection/composited_touch_handle_drawable.h", + "android/selection/magnifier_surface_control.cc", + "android/selection/magnifier_surface_control.h", "android/selection/selection_popup_controller.cc", "android/selection/selection_popup_controller.h", "android/selection/smart_selection_client.cc", @@ -3039,11 +3068,8 @@ source_set("browser") { "android/web_contents_observer_proxy.h", "attribution_reporting/attribution_input_event_tracker_android.cc", "attribution_reporting/attribution_input_event_tracker_android.h", - "attribution_reporting/attribution_os_level_manager.h", "attribution_reporting/attribution_os_level_manager_android.cc", "attribution_reporting/attribution_os_level_manager_android.h", - "attribution_reporting/os_registration.cc", - "attribution_reporting/os_registration.h", "child_process_launcher_helper_android.cc", "contacts/contacts_provider_android.cc", "contacts/contacts_provider_android.h", @@ -3206,6 +3232,8 @@ source_set("browser") { "webauth/virtual_fido_discovery_factory.h", # The Document Picture-in-Picture API is not implemented on Android. + "picture_in_picture/document_picture_in_picture_navigation_throttle.cc", + "picture_in_picture/document_picture_in_picture_navigation_throttle.h", "picture_in_picture/document_picture_in_picture_window_controller_impl.cc", "picture_in_picture/document_picture_in_picture_window_controller_impl.h", ] diff --git a/src/media/ffmpeg/ffmpeg_common.cc b/src/media/ffmpeg/ffmpeg_common.cc index 050f0b1c..164b34dc 100644 --- a/src/media/ffmpeg/ffmpeg_common.cc +++ b/src/media/ffmpeg/ffmpeg_common.cc @@ -744,7 +744,7 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, AVMasteringDisplayMetadata* metadata = reinterpret_cast(side_data.data); if (metadata->has_primaries) { - hdr_metadata.color_volume_metadata.primaries = { + hdr_metadata.smpte_st_2086.primaries = { static_cast(av_q2d(metadata->display_primaries[0][0])), static_cast(av_q2d(metadata->display_primaries[0][1])), static_cast(av_q2d(metadata->display_primaries[1][0])), @@ -756,9 +756,9 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, }; } if (metadata->has_luminance) { - hdr_metadata.color_volume_metadata.luminance_max = + hdr_metadata.smpte_st_2086.luminance_max = av_q2d(metadata->max_luminance); - hdr_metadata.color_volume_metadata.luminance_min = + hdr_metadata.smpte_st_2086.luminance_min = av_q2d(metadata->min_luminance); } } @@ -914,26 +914,6 @@ VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) { return PIXEL_FORMAT_UNKNOWN; } -VideoColorSpace AVColorSpaceToColorSpace(AVColorSpace color_space, - AVColorRange color_range) { - // TODO(hubbe): make this better - if (color_range == AVCOL_RANGE_JPEG) - return VideoColorSpace::JPEG(); - - switch (color_space) { - case AVCOL_SPC_UNSPECIFIED: - break; - case AVCOL_SPC_BT709: - return VideoColorSpace::REC709(); - case AVCOL_SPC_SMPTE170M: - case AVCOL_SPC_BT470BG: - return VideoColorSpace::REC601(); - default: - DVLOG(1) << "Unknown AVColorSpace: " << color_space; - } - return VideoColorSpace(); -} - std::string AVErrorToString(int errnum) { char errbuf[AV_ERROR_MAX_STRING_SIZE] = {0}; av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); diff --git a/src/media/media_options.gni b/src/media/media_options.gni index 24429872..da8810a7 100644 --- a/src/media/media_options.gni +++ b/src/media/media_options.gni @@ -110,6 +110,10 @@ declare_args() { # with hardware acceleration assist. Enabled by default for fuzzer builds, # ChromeOS builds with protected content support, Windows, Mac, and Android. enable_hevc_parser_and_hw_decoder = true + + # Enable inclusion of VVC/H.266 parser/demuxer, and also enable VVC/H.266 decoding + # with hardware acceleration provided by platform. Disabled by default for all builds. + enable_platform_vvc = false } # Use another declare_args() to allow dependence on args defined above. diff --git a/src/ui/webui/resources/images/BUILD.gn b/src/ui/webui/resources/images/BUILD.gn index 2d0008f7..be3ef952 100644 --- a/src/ui/webui/resources/images/BUILD.gn +++ b/src/ui/webui/resources/images/BUILD.gn @@ -38,6 +38,7 @@ generate_grd("build_grdp") { "throbber_small_dark.svg", "throbber_small.svg", "tree_triangle.svg", + "2x/checkbox_black.png", "2x/checkbox_white.png", "2x/check.png", @@ -55,6 +56,7 @@ generate_grd("build_grdp") { "icon_arrow_back.svg", "icon_arrow_dropdown.svg", "icon_bookmark.svg", + "icon_checkmark.svg", "icon_clear.svg", "icon_clock.svg", "icon_delete_gray.svg",